Trigger running on creation AND on update

6 Comments

  • Dan Ross
    Community Moderator

    Hey Sebastian,

     

    If you add:

    Ticket is Created

    Ticket is Updated

     

    Under the 'Any' section of the trigger conditions, it should fire on create and update events.  

     

    0
  • Nicole S.
    Zendesk Community Team

    Thanks for sharing that solution, Dan. Sebastian, let us know if that solves the issue for you. 

    0
  • Sebastian

    Thanks for the idea, strange that trigger aren't triggered ALWAYS anyway when a ticket gets created or updated.

    In any case this would not work when I would want to run the trigger with other conditions like
    commenttext contains "this is an emergency"
    or
    "this is not true"
    because this trigger would get triggered always because one of these 4 conditions is always true.

    It might be possible to create a trigger that only contains created and updated and then set a certain keyword. Then in each other trigger put this keyword as a binding requirement for the trigger to run. Though I'm not sure if these other triggers then would be started at all without being asked for created or updated again.

    0
  • Sebastian

    It seems the trigger can only be saved when there is an all condition set.I used ticket is not closed.

    And it works. all other tickets need as all criteria the keyword. all other criterias can be set normally.

    Looks like it works, the additional keyword "changed" I used, is not so good, since it has to be in every ticket, but at least it does the trick.

    0
  • Dan Ross
    Community Moderator

    While it probably seems frustrating now, it's actually quite a good thing triggers aren't executed on every action. Sometimes there's a need just for selective activation.

     

    For the objective you're describing, you could try something like:

    ALL Conditions

    Status less than Closed

     

    ANY Conditions

    commenttext contains the following string "this is an emergency"

    commenttext contains  the following string  "that is not true"

    ----

    Since any tickets you can actually act on are always less than Closed (New -> Solved) this should always be true. This frees up the ANY section for the actual criteria you want to evaluate.

    A word about string matching (that I learned the hard way) - unless you're piping in tickets from a system that defines the string (a system that sends data with fixed content that you know will always be an exact match) it's very easy to miss catching on events. You may have more success using the contains at least one of the following and then enter an array of synonyms. Customers may write in different styles that express the same sentiment.

     

    For example, instead of: 

    comment text contains the following string "this is an emergency"

    Consider:

    comment text contains at least one of the following words "emergency urgent critical catastrophe serious"

     

    EDIT: I replied to the email notification from your earlier comment before you found a solution. Seems the emails are a bit delayed. Glad you found something that works!

    0
  • Nicole S.
    Zendesk Community Team

    I'm going to move this thread over to Q&A so that other users can more easily find it for their own troubleshooting purposes. 

    0

Please sign in to leave a comment.

Powered by Zendesk