ticket.saved event triggering twice for every ticket save. | The place for Zendesk users to come together and share
Skip to main content
Gayathry
October 29, 2021
Question

ticket.saved event triggering twice for every ticket save.

  • October 29, 2021
  • 6 replies
  • 31 views

I have build a background app using ZAF, the purpose of which is to track changes in ticket field values and call an api on my server if specific conditions are met. I am making use of the ticket.saved event as mentioned in the documentation. However, on saving a ticket, the event is called twice - once during update and once during save. Is there a way for me to avoid this "double trigger" issue? Or is there some other event or similar hook that can help me serve the purpose?

If anyone of you know a solution to the issue,could you please help?

6 replies

Tipene
Employee
November 1, 2021

Hi @gayathry,

Thanks for reaching out!

Would you mind dropping a snippet of the relevant code here so I can look into this a bit further for you? Just be sure to redact any sensitive information.

Thanks!

Tipene

Gayathry
GayathryAuthor
November 1, 2021

@tipene Here is the code, Every time a ticket is saved, the data is consoled twice.

Tipene
Employee
November 1, 2021

Thanks, @gayathry!

Nothing immediately stands out here as to why that would be happening and I've just tried to reproduce using the code you sent and it's working fine on my end.

Do you mind if I move this to a private ticket so I can take a look at the full code base?

Gayathry
GayathryAuthor
November 1, 2021

@tipene Hi, When tickets are saved there are two notifications that I can see - one that the ticket was updated and that the ticket was saved. Does this help? 

Tipene
Employee
November 1, 2021
No, that's expected behavior and generally shouldn't have any effect based on the code you've shared. 
 
I'd need to dive a bit deeper into your code to be able to determine what's causing the issue so let me know if you'd like to move this to a private ticket or, feel free to provide additional context in screenshots here!
 
Tipene
Gayathry
GayathryAuthor
November 2, 2021

@tipene Sure, let us move to a private ticket