# Trigger with State=Closed&Action=Updated conditions does not work

**URL:** <https://community.zammad.org/t/trigger-with-state-closed-action-updated-conditions-does-not-work/10487>\
**Category:** Technical assistance\
**Created:** [November 30, 2022, 2:40pm UTC](https://community.zammad.org/t/trigger-with-state-closed-action-updated-conditions-does-not-work/10487 "2022-11-30T14:40:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![igodsewer](https://community.zammad.org/user_avatar/community.zammad.org/igodsewer/32/6517_2.png) [@igodsewer](https://community.zammad.org/u/igodsewer)\
**Post date:** [November 30, 2022, 2:40pm UTC](https://community.zammad.org/t/trigger-with-state-closed-action-updated-conditions-does-not-work/10487/1 "2022-11-30T14:40:18Z")

</div>

### Infos:

- Used Zammad version: 5.2.3
- Installation method (source, package, ..): Package
- Operating system: Ubuntu Server 22.04
- Database + version: Postgres 12.12
- Elasticsearch version: 7.17.0
- Browser + version: Chrome 107.0.5304.121

### Expected behavior:

When a Customer replies to a closed ticket, he should be emailed with a warning, ticket status changed to “Opened” and its priority raised.

### Actual behavior:

Ticket is only reopened, seems like not by the trigger but rather with follow-up settings of its ticket group. That said, follow-up actions are applied before ticket action is checked against triggers, which seems like a bug.

### Steps to reproduce the behavior:

Create a trigger with:

State is closed  
Action is updated  
Sender is Customer  
Type is email

[![image](https://community.zammad.org/uploads/default/original/2X/6/6dbe7a166e8cb1b0aaf9ce83332922f9ee1946cb.png)](https://user-images.githubusercontent.com/5046970/204808877-23bf13c3-2026-4da3-8db5-1ffcd6cf218b.png)  
[![image](https://community.zammad.org/uploads/default/original/2X/3/3794ad262e4540ed8b766a05f69257ab85aca90e.png)](https://user-images.githubusercontent.com/5046970/204809004-44690cd9-ba42-4e46-ae27-347c2f483dab.png)

Email Zammad to create a ticket, then close the ticket.  
When its closed, reply to ticket from email to re-open it.

That’s a repost from [Trigger with State=Closed&Action=Updated conditions does not work · Issue #4399 · zammad/zammad · GitHub](https://github.com/zammad/zammad/issues/4399)

Any ideas? I’ve been told this is not a bug, so I probably need explanation on how this works ☹

---

<div class="post-metadata">

**Author:** ![Sal](https://community.zammad.org/user_avatar/community.zammad.org/sal/32/7525_2.png) [@Sal](https://community.zammad.org/u/Sal)\
**Post date:** [November 30, 2022, 4:20pm UTC](https://community.zammad.org/t/trigger-with-state-closed-action-updated-conditions-does-not-work/10487/2 "2022-11-30T16:20:05Z")

</div>

I don’t think your trigger will work at all. When the customer replies, the ticket state is changed to open. Therefore your trigger does not apply. It will only apply to closed ticket states.

May want to try changing that to State has changed. See if that helps you achieve what you are looking for.

---

<div class="post-metadata">

**Author:** ![richie\_77](https://community.zammad.org/user_avatar/community.zammad.org/richie_77/32/5964_2.png) [@richie\_77](https://community.zammad.org/u/richie_77)\
**Post date:** [November 30, 2022, 7:28pm UTC](https://community.zammad.org/t/trigger-with-state-closed-action-updated-conditions-does-not-work/10487/3 "2022-11-30T19:28:21Z")

</div>

I use tags like „already closed“ for such a behaviour. Maybe this will work for you. Add a tag on ticket closing and then in your trigger check, if this tag exists.

---

<div class="post-metadata">

**Author:** ![igodsewer](https://community.zammad.org/user_avatar/community.zammad.org/igodsewer/32/6517_2.png) [@igodsewer](https://community.zammad.org/u/igodsewer)\
**Post date:** [November 30, 2022, 11:29pm UTC](https://community.zammad.org/t/trigger-with-state-closed-action-updated-conditions-does-not-work/10487/4 "2022-11-30T23:29:50Z")

</div>

Could you please share a bit details on that? Would really appreciate this!

---

<div class="post-metadata">

**Author:** ![richie\_77](https://community.zammad.org/user_avatar/community.zammad.org/richie_77/32/5964_2.png) [@richie\_77](https://community.zammad.org/u/richie_77)\
**Post date:** [December 1, 2022, 2:47pm UTC](https://community.zammad.org/t/trigger-with-state-closed-action-updated-conditions-does-not-work/10487/5 "2022-12-01T14:47:41Z")

</div>

I just tested this. This is my Workflow:

- Ticket is set to “pending close”
- The “pending close” - event fires and set the ticket state to “To close”(\*)
- An automatization every 10 minutes looks for tickets with state “To close” and sends an email to the customer, that the ticket is closed, adds a “already closed”-tag and closes the ticket

 ![zammad-trigger1](https://community.zammad.org/uploads/default/original/2X/7/71c0b541c0235a0103f84ef85741629c4a53977b.jpeg)

- now the customer replies, the ticket state changes and a trigger fires, sends the warning mail and remove the “already closed”-tag

 ![zammad-trigger2](https://community.zammad.org/uploads/default/original/2X/a/a98749e05d3a5fa22c2b4b1b197a069da4ff0207.jpeg)

This works for me, as you expected.

(\*) You have to change the settings from the ticket state “pending close” in order to get this example working. The property “next\_state\_id” have to be set to your newly created ticket state “to close”.

---

<div class="post-metadata">

**Author:** ![system](https://community.zammad.org/uploads/default/original/1X/5c5afaea2d23f811dbec33cd4edb02fa29d3262f.png) [@system](https://community.zammad.org/u/system)\
**Post date:** [March 31, 2023, 2:48pm UTC](https://community.zammad.org/t/trigger-with-state-closed-action-updated-conditions-does-not-work/10487/6 "2023-03-31T14:48:07Z")

</div>

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