Ticket Changed event webhook created a loop

We are using the event, 'Ticket Changed', to trigger a webhook. When a custom attribute on the ticket is changed, the webhook calls a webservice. This webservice calls a TDX API to update the status of of the ticket, leave a comment and send a notification.

It seems that after the ticket is updated through the API, the webhook fires again because the ticket changed.  Is there a way around this loop that we have created?

 

 

Tags webhook
Asked by Bobby Jones on Mon 7/5/21 2:59 PM
Sign In to leave feedback or contribute an answer

Answer (1)

This answer has been marked as the accepted answer
Mark Sayers Tue 7/6/21 10:43 AM

Hello Bobby,

Unfortunately on the TDX side of things there is no way to filter or create a profile of when to send a webhook call. Just about anything that touches the ticket basically fires ticket changed. You would have to put filtering in your client-side code that "receives" the web hook to try to detect what exactly changed and only do certain actions when those things have changed. Which is also difficult because the web hook doesn't tell you what changed. It only provides the current state of the ticket post-change.

There are enhancement requests around those I believe, but you can certainly also submit one to add your voice to it.

 

I'm not certain what the best way to try to attempt this would be, short of keeping an external database of tickets that updated to compare things against. Or trying to get the ticket feed and scrape out comments (all this would be done client-side by your receiving code/system).

I wish I could be more helpful that this but unfortunately the webhooks aren't yet to the point to give information on what​​​​​​​ actually changed on a ticket, only the fact that​​​​​​​ a change happened.

Sincerely,
Mark Sayers
Sr Support Consultant, CS

No feedback
Thanks. I think we are going to try an external audit table to help us decide when to call the Ticket update API - Bobby Jones Wed 7/7/21 12:39 PM