Changing request owner on trigger before save.

lock
push_pin
done
Besvart
4

Hello. 

In the old Servicethere was an out of box functionality that when a user changes the status of a request to closed then she will automatically be set to the owner of the ticket. 

Is there a preference for this in the new Service module ? 

Even if there is, I would like to be able to manipulate this by using the Trigger before save on Service, but I'm not able to make it work. 

These are the input fields related to "OwnedBy" retrieved by the trigger on save button pressed: 

"TicketEntity.OwnedBy.AssociateId": "0",
  "TicketEntity.OwnedBy.Deleted": "false",
  "TicketEntity.OwnedBy.EjUserId": "0",
  "TicketEntity.OwnedBy.FormalName": "",
  "TicketEntity.OwnedBy.FullName": "(Unassigned)",
  "TicketEntity.OwnedBy.GroupIdx": "0",
  "TicketEntity.OwnedBy.Name": "",
  "TicketEntity.OwnedBy.PersonId": "0",
  "TicketEntity.OwnedBy.Rank": "0",
  "TicketEntity.OwnedBy.Tooltip": "",
  "TicketEntity.OwnedBy.Type": "Unknown",
  "TicketEntity.OwnedBy.UserName": "",

Ive tried to use ed.setOutputValue("TicketEntity.xx.xx") using everything from ejUserId to name and FormalName but it does not seem to work.
Isn't it at all possible to set ticketOwner from request before save trigger ? 

Also, I know that i can use the request after save trigger but then i would need to navigate away from the screen or refresh for the correct owner to show in the field.




10. jul. 2024 | 11:30 a.m.

Alle Svar (4)

Hi,

This code works for me to set owner;

11. jul. 2024 | 09:07 a.m.
I've struggled with this before as well and also observed that setting the value via AssociateId is the only working method (which is OK, if you know it :) )
11. jul. 2024 | 09:28 a.m.
Thank yu @Michael and Bas!
I'll try it later today.

If I remember correct, I have the same problem with setting ticket status and category.
Any of you good fellas have tips for that ?
11. jul. 2024 | 09:42 a.m.
Hi Ummair,

For those items I think simply setting the "ID"-field of the item in the eventdata should do the job. For the owner, we have different relations (ejuser and associate), but for the fields you refer to, there is simply one ID-field.
11. jul. 2024 | 11:11 a.m.

Legg til svar