Trigger to revert ticket state to previous


  • Used Zammad version: 5.4.1
  • Used Zammad installation type: Docker
  • Operating system: running on kubernetes (Ubuntu)
  • Browser + version: -

According to this answer it should be possible to create a trigger to revert a ticket status change. Can anybody show me how? I haven’t found an option to get the previous state.

The usecase is as follows: We created a custom ticket state for when our customers have broken items and want them to get checked. We set the ticket state to “return of goods”, creating a webhook which will send the customer all infos needed + packaging instructions as PDF.
Most of our customers reply to that via mail (“item sent”, “here is the tracking number”, etc.) resulting in the state defaulting to “open”.

This makes it very hard for our support to follow the current state.
If they change the ticket state to “return of goods” manually the mail and attached PDF will get send once again of course…

Expected behavior:

  • Making it possible to NOT set the state automatically to “open” once a customer writes a mail

Actual behavior:

  • Ticket state is getting changed to “open”
1 Like

I think that’s the difference between a pending state and a non-pending state. Non-pending states won’t revert to a different state on update or when a condition has been met, while pending states will. It is explained in the docs. You probably want to check the custom ticket state’s configuration and make sure it is a non-pending state.

If I get you right a ticket in Zammad’s default state ‘closed’ should stay closed on new mail? Because that’s also not the case for me

No, that’s not quite right. Closed is also a kind of pending state. In its default configuration, Zammad will re-open a ticket when a customer sends a response to a ticket which has previously been closed.

Not a kind of pending state. Its type is “closed”. Please let’s not mix up phraseology here :pray:
Closed states, like any other ticket state in Zammad by default fall back to the state “open” if there’s been any communication from the customer to the ticket. This is supposed to protect you from missing customer replies.


But you could receive a notification without changing the state of the ticket as when another agent adds a comment in one of the tickets you are subscribed to. For us, the “problem” with this default behavior is that you can easily forget to set the ticket back to pending state and miss a deadline for the ticket.

If there is any way to avoid change a state to open on a new response, will resolve my request too.

1 Like

Please don’t hijack threads with other issues, especially not to bump them.

If you believe this is a missing function, feel welcome to create a feature request here:

You can also adjust with tags and stuff, but that’s sketchy of course.

Same problem for me with pending states and still VERY important for us making Zammad able not to revert states after Customer answers in some cases.

In your case, you could create a trigger. For Pending states, this is impossible because you can’t revert the set time and date.

Our trigger reads another field and keeps closed tickets closed.
We created a field “keep close” boolean.
Its default is false.

A trigger sets it to true if a ticket state changes to open.
Another trigger sets all tickets to closed, where the state is not closed and where “keep close” is set true.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.