Learn how to order your triggers

Have more questions? Submit a request

5 Comments

  • Christina Libs
    Comment actions Permalink

    Post your question, suggestion, or idea about this article here in the comments!

    0
  • ES
    Comment actions Permalink

    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-

    0
  • Matteo
    Comment actions Permalink

    Hello,

    For point 1, you are correct, just keep in mind these 3 points:

    1. Triggers fire as a consequence of a ticket update. This fact should always be kept in mind when creating or debugging any triggers issue.
    2. When a ticket is updated, the system checks triggers for a match in a sequential order, from the top of your trigger list, to the bottom.
    3. 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.

    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:

    • 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, [...]

    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!

    0
  • ES
    Comment actions Permalink

    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").

    0
  • Matteo
    Comment actions Permalink

    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!

    0

Please sign in to leave a comment.

Powered by Zendesk