"Outbound email or SMS created" Trigger override request status

lock
push_pin
done
Besvart
0

I have a trigger on "Outbound email or SMS created" that overrides the message template to force the user to log into our self service solution to read the content.

This trigger works fine, except for one thing. If the support personell chooses to close the request while adding a message, the request is only sometimes being closed. It looks like it is closed at first sight, but if refreshing the browser I see that the request is still open.

I have added logging in the Trigger script and can see that the ticket has the wrong state when fetching from the script, so I guess the problems are some kind of race problem.

In the change log of the request it also looks like the request is closed, even if it is open.

Any suggestion as to how to solve this? should i add a sleep() to the trigger?

EventData ed = getEventData();
if (ed.getInputValue("outbox.eventName") == "addMessage") {

  Integer ticketId = Integer(ed.getInputValue("outbox.ticketId"));
  NSTicketAgent ticketAgent;
  NSTicketEntity ticket = ticketAgent.GetTicketEntity(ticketId);
  NSTicketCategoryEntity c = ticket.GetCategory();
  NSTicketStatusEntity status = ticket.GetStatus();

  log(status.GetName());
 //wrong status

29. des. 2025 | 01:12 p.m.

Alle Svar (0)

Legg til svar