Post internal comment with trigger

Answered

13 Comments

  • Official comment
    Nicole Saunders
    Zendesk Community Manager

    Please note, this workflow is not recommended or supported as errors are likely to occur when the ticket is being updated by triggers and the API simultaneously. When this happens, it is called a race condition. Triggers are used to explain this issue below, but the same principles apply to automations.

    Every time a ticket is created or updated, all of your triggers run in a cycle against that ticket. A trigger will fire and update the ticket if its conditions are met during the cycle. A cycle is the entire process of a ticket being checked against all your triggers.

    When a trigger updates a ticket using our API, the update occurs at some indeterminate point in the cycle. Results can vary based on when the ticket update occurs in the cycle. The ticket update can affect whether other triggers fire.

  • Andreas Schuster

    Hi @...,

    There is a workaround where you can update Zendesk itself.

     

    Trigger

    I can only advise you to set up this Trigger on ticket creation, or work with tags so that you can ensure it only fires once with ticket update. (worst case is a loop which spams your ticket with internal notes)

     

    URL Target (Extension)

    https://XXX.zendesk.com/api/v2/tickets/{{ticket.id}}.json?ticket[comment][public]=false

    Let me know if this works for you.

    Cheers,

    0
  • Hege Solheim

    Thank you, that worked perfectly! 

    0
  • Justin Federico

    Exactly what I was looking for. Thank you for this!

    0
  • Jem

    i got stuck in the spam loop - any ideas on how to stop this?

    0
  • Justin Federico

    @...

    Does your trigger fire on creation or on update? If on update, you need another action on the trigger that will add a tag or set a field value on the ticket. You will also need to add that tag/value as a trigger condition that will prevent the trigger from firing if the tag/value exists.

    0
  • Jem

    @...

    Thank you, I tried it on both but in a loop. Slightly confused. If  I set a tag to fire the trigger, do you mean on that same trigger I would also have to set another 'is not x tag' condition?

    I've managed to work around it at the moment by setting the trigger on tickets that are changed from New, but if you have a screenshot that would be much appreciated!

    0
  • Dawn Anderson

    This is a pretty cool trick!

    Just so I'm reading it right, I only need to amend where it's XXXX below with my Zendesk domain?

    https://XXX.zendesk.com/api/v2/tickets/{{ticket.id}}.json?ticket[comment][public]=false

    0
  • Justin Federico

    If using tags, You have one tag that will fire the trigger and you will need a second tag that prevents it from continually firing. The trigger should add that second tag in its actions.

     

    0
  • Jem

    Thank you superstar! @...

    @... it worked for me by creating a http target and inserting the following: https://XXXXX.zendesk.com/api/v2/tickets/{{ticket.id}}.json

     

    0
  • Justin Federico

    @... You're Welcome. Happy to help!

    @... Correct. You only need to add your domain.

    This part of the API call is required to make the comment internal but not required otherwise.

    ?ticket[comment][public]=false

     

    0
  • Bobby Koch

    can we do this with webhooks now?

    0
  • Dave Dyson
    Zendesk Community Manager
    0

Please sign in to leave a comment.

Powered by Zendesk