Automatically delete users/customers if there are no tickets assigned

Request based on topic Automatically delete users/customers if they have no tickets assigned

Zammad currently lacks the option to automatically delete users based on certain criteria.
A basic one would be to delete users (or in this case customers) that have no tickets assigned to them.

There is however an option to delete customers including assigned tickets manually. Depending on the size of the ticketsystem and amount of agents this might not be feasible for everyone.

So in order to make life easier for those and to more easily comply with GDPR the scheduler should have the option to check for users/customers without any tickets assigned to them and then be able to delete them.
Might either need a warning or condition the action “delete user” to only be available for the filter “customers with no tickets”.

Regarding LDAP or other integration: Either skip those or just delete them and let them resync, as long as there is no ID being counted in the background that has the potential to overflow I don’t see too much of a problem here.

8 Likes

This topic was automatically closed after 416 days. New replies are no longer allowed.

Good news — this is possible since Zammad 6.2 (first release where the docs spell it out explicitly).

What you can do today:

Create a Scheduler task with:

  • Object: User
  • Condition: any standard condition on the user that narrows down the target set — e.g. the user’s created at is older than 30 days, no tag present, a specific e-mail domain, or a condition on linked ticket attributes (Zammad’s condition builder evaluates against the user and their associated tickets, so a scheduler condition can target users whose tickets match — or do not match — certain criteria).
  • Action: Add a data privacy deletion task — this enqueues a Data Privacy task that deletes the user and all their tickets (Zammad does not allow deleting a user while keeping their tickets).

You can schedule it to run daily, weekly, on specific days — whichever fits.

Why it solves GDPR cleanup out of the box: The Data Privacy mechanism is the same one you would use manually under System → Data Privacy, so it is audited, queued, and logged the same way — you just remove the manual loop.

Docs:

From a user’s perspective I’d say this is implemented. If your use case needs something the condition builder cannot express (e.g. ‘no tickets owned OR mentioned for 30 days’), the same scheduler + action combo still works — Zammad’s condition engine is flexible enough to cover it. Flag it in the thread if I missed your exact case.