The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Previously Assigned To

amacqueen
Mega Guru

I'm looking for a way to display on an incident form the last user an incident was assigned to. I need to do this because we are using a tool to automatically assign incidents to the service desk and if an incident is simply rejected to the service desk there is a high probability it will be assigned to a different member of the team.

 

TIA

1 ACCEPTED SOLUTION

Sorry about that, I should have been more specific.



You likely need to take these steps:



  1. Delete the "Previously Assigned To" field-- do this by right clicking on the field label, say "Personalize Dictionary" and then use "Delete".

  2. Recreate the "Previously Assigned To" field, this time making sure to specify that it's a reference field to the User (sys_user) table.

View solution in original post

9 REPLIES 9

Brad Tilton
ServiceNow Employee
ServiceNow Employee

I believe the standard approach would be to add a new field to the form to hold the previous assigned to and populate it with a business rule. You could access that data by querying the metrics table, but it's a little more complex.


First off, I'd recommend following the advice given by "mguy" or "Kalaiarasan".



That said, if you do want to go the route of creating a new field, this should help:



Step One:


* Create a field called "Previously Assigned To" (the actual database name will be "u_previously_assigned_to").


* Make sure that field is on the place on the form and list view where you want it to appear, by using "Personalize Form Layout" and "Personalize List Layout".



Step Two:


* Create a business Rule called "Set Previously Assigned To".


* Check the Advanced Checkbox up top.


* For "When to Run", Check "Update", and set "When" to be "Before"


* For the Filter Conditions on When to Run, set it to "Assigned To Changes".


* On the Advanced tab, set the script field to contain:   "current.u_previously_assigned_to = previous.assigned_to;"


* Save/Submit


Thanks Garrett that would be useful, I've tried it in test and it works except the Previously Assigned To field appears to show the sysid rather than the user name.



I've tried changing the BR script to:-


current.u_previously_assigned_to = g_form.getValue(previous.assigned_to)



But that didn't work either.


Sorry about that, I should have been more specific.



You likely need to take these steps:



  1. Delete the "Previously Assigned To" field-- do this by right clicking on the field label, say "Personalize Dictionary" and then use "Delete".

  2. Recreate the "Previously Assigned To" field, this time making sure to specify that it's a reference field to the User (sys_user) table.