Ticket.load() not working in some instances

lock
push_pin
done
Answered
2

We have a webhook (that runs on "Ticket.Created") and in that webhook are we trying to load the ticket in order to update some values, however recently have we gotten alot more instances where the method "Load" in the Ticket class returns false which ends the hook since we can´t update the ticket.

So my question is just regarding the method "Load" and why it seems to fail sometimes. 
Is there any value in the ticket that makes the "Load" fail or could the webhook fire too fast before the ticket has been 100% created? 


29 Jan 2025 | 06:39 AM

All Replies (2)

Since you are mentioning the native CRMScript ticket class, I assume this a crmscript webhook. Do note that these are run in the context of the user triggering the event. So if a user creates a ticket in a category they do not have access to, the ticket.load will fail there. 

29 Jan 2025 | 08:00 AM
Yes, my bad. It´s a crmscript based webhook.
These requests are created from e-mails so the "system" is the user in this case.
Do the system user override these rules or does we need to add it to every category?
It also seems to be a pattern when the webhook fails to load the ticket cause it only seems to fail 1-2 minutes per time. (For exempel, this could happen during the morning and then after lunch for just 1-2 minutes.)
29 Jan 2025 | 08:09 AM

Add reply