If you're reading this in our web widget, consider expanding the article for a better reading experience.
Whether you are starting from scratch or working with an established environment, the order of your triggers is important for a well designed Zendesk account.
There is no perfect order for triggers that can fit every account, but we suggest these guidelines to create a better structure, providing an environment where your triggers fire at the right time and situation.
Use dividers
Dividers help show the role of the triggers in your list
In this example, we have divided our trigger list into 3 categories:
- set
- assign
- notify
Each category explains the high-level function of the triggers and focus on the trigger actions.
Therefore, in the set category, we find only triggers that set data as final action, in the assign category, we find triggers that assign tickets to users, and so forth.
This way of visually separating triggers helps you locate a specific trigger in a list, and makes debugging you triggers easier.
For detailed instructions, see the article: How do I organise the triggers of my account?
Adopt a naming convention
Naming conventions help provide information at a glance
This is important when multiple users are creating triggers. You can think about it as a short instruction manual on how to use the trigger.
The trigger naming conventions we suggest are:
- Emoji
- Department
- Category
- Action
- Owner
- Title
- Number
Emoji
Emojis can visually represent meaning. Use this feature to highlight the key trigger action. Above, we used the emoji for outbound emails in a trigger that sends out a notification via email to customers.
Department
Above, we used the department 'Customer Service' to make sure the trigger is not confused with some other triggers with the same function.
Category
This is the part that locates the trigger function in your organization. Above, we use 'Support', but it could be Sales, Customer Success, etc.
Action
The action performed by the trigger. In the example, notify customers of a received request.
Owner
Who has created or manages the trigger. This is useful when you need to contact the owner of a trigger for further explanation.
Title
The title of the trigger.
Number
Sometimes you have triggers that act as a block of actions, multiple triggers fire one after the other. Using numbers helps to understand the workflow and facilitate debugging potential issues.
Break down complex workflows in several triggers
Organize triggers in a logical order for clarity
When dealing with complex workflows, it might not be possible to condense all the trigger conditions and actions in a single trigger.
When that's the case, breaking down the workflow into several triggers can be the solution. For example, you can have 4 triggers:
- emoji/department/category/action[set-tag1]/owner/title/1/4
- emoji/department/category/action[set-tag2]/owner/title/2/4
- emoji/department/category/action[set-tag3/owner/title/3/4
- emoji/department/category/action[notify-group1]/owner/title/4/4
The first trigger sets some data, for example, a tag, that causes the second trigger to fire. The second trigger sets another tag that causes the third trigger to fire, so on and so forth until the fourth trigger fires to notify a group, and the workflow ends.
Advantages of this design:
- Debugging: the first trigger firing acts as leader, in that if the following trigger in the sequence does not fire, the issue is likely in the trigger leader.
- Clarity: the actions are likely smaller, clearer in their intent, and easier to understand.
- Numbers: using numbers in the naming convention help visualize and organize these small, targeted use cases.
Understand the sequence in which the triggers fire
Triggers fire as a consequence of a ticket update
Triggers fire as a consequence of a ticket update. This fact should always be kept in mind when creating or debugging any triggers issue.
When a ticket is updated, the system checks triggers for a match in sequential order, from the top of your trigger list to the bottom.
When a match is found, the system checks the triggers once again from the top of the list, this time skipping those triggers that have already fired.
This behavior means that:
- A ticket could loop through the trigger list several times for a single ticket update.
- A trigger can be checked several times during a cycle, but never fire more than once on the same ticket update, because the trigger is not checked again after it fires.
- A trigger will not fire if it's not a match.
It's important to consider such implications prior to decide the order of your triggers.
For more details and a visual representation of this process, see the article: About triggers and how do they work.
11 Comments
Post your question, suggestion, or idea about this article here in the comments!
If a triggered is triggered, is the ticket updated *before* the next trigger is checked? The text and diagram in [1] seems to suggest this is the case.
If so, I wonder if we could solve for [2] by making the webhook trigger be the last trigger in the list. If the last trigger on the list only sends a webhook for new tickets, and does not modify the ticket in any way, could we imply that when we receive the webhook, the trigger cycle has concluded for the ticket?
[1] https://support.zendesk.com/hc/en-us/articles/203662246-About-triggers-and-how-they-work
[2] https://support.zendesk.com/hc/en-us/articles/234658247-Can-I-use-a-trigger-and-a-target-to-update-tickets-
Hello,
For point 1, you are correct, just keep in mind these 3 points:
For point 2, theoretically, the scenario you propose could potentially work, but it won't save you from potential racing condition issues or inconsistent results/behaviours, which is why the workaround itself is prone to errors.
The main points to consider are:
I would recommend testing these types of workaround very carefully before considering a production use, and also utilise them for small updates, for a long period, and monitor the success rate. In case of failure, this should be considered a foreseen side-effect, and not a product-related malfunction.
Hope this helps!
Matteo thanks for the reply. Can you be more precise as to when the trigger cycle loops back?
- Is it when a trigger's conditions are met?
- Or is it when a trigger's conditions are met AND the ticket is updated? - For example, if the action is sending a webhook, one would think that that is not the same thing as updating a ticket.
Your comment suggests the first point is what happens, but https://support.zendesk.com/hc/en-us/articles/203662246-About-triggers-and-how-they-work makes it seem like it's the second point ("If a trigger updates a ticket during the cycle, the cycle starts over").
Hello,
No problems at all.
I understand the confusion defining what "update" means.
Both your statements are correct, but they need to be considered together: if conditions are met > a trigger fires > an update occurs (notify a user, setting up a tag, firing a target, etc) > start over
Hope this helps!
Thanks Matteo for this useful article.
One thing I was looking for which bugs me a bit, is how to change the order of triggers that are on page 2. I can't seem to get them any higher than to top of page 2...
And there have been cases where I need newly created triggers (which goes to the bottom of the list at first) to be higher up in the trigger order.
As helpful as these tips are, they ultimately are workarounds to address a lack in software functionality. I would really like to see a native option to fully organize triggers!
Doubly helpful if that when "sorting" the list, you don't lose the ability to drag a trigger/group of triggers into desired locations- relative to the sorting applied.
There are so many optimizations to the handling of triggers that could be had! As a Zendesk user with over 8 years of experience, it pains me that this area of the product receives so little love, especially considering how much of a core element it is to the Zendesk product.
Hello Fred Thomas,
Regarding product limitations and the desire to see improvements in these areas, I would recommend posting your thoughts in our product feedback forums. That way, our developers can consider your ask for future updates.
Best regards.
Kristin Bouveng I don't have pages in the trigger list (I don't have many), but in your case I would play with deactivating/reactivating the triggers to accomplish that.
The notice that I saw said essentially to "Click here to watch how to create a trigger" - where is the video?
Hi Tom Lam,
Welcome to the Zendesk online Community!
I guess you are referring to this How do I create a trigger? [Video] posted on the upper right side under related articles. You can click the link above to watch the video.
If you have any further questions or concerns, please let me know! :)
Please sign in to leave a comment.