Creating a "Previous Assigned Groups History Field" in Incident View

Max Lin
Tera Contributor

Hi There! I'm new to servicenow and trying to learn. 

I would like to create a "Previous Assigned Groups" field in Incident View so that it can have a one look clear cut of all the assigned groups which was assigned before in the Incident View. This is also able to be exported out in Excel together with the incidents. 

Something like this: 

find_real_file.png

 

If possible, please give me detailed steps please. Thank you so much. 

1 ACCEPTED SOLUTION

Anil Lande
Kilo Patron

Hi,

You can achieve this using business rule or Flow.

1. Create a string field.

2. Create a business rule which should run when Assignment Group changes.

Use below configuration.

find_real_file.png

And use below script logic:

(function executeRule(current, previous /*null when async*/) {

if(current.u_assignment_gorups !=''){  //use name of your field instaed of u_assignment_gorups
current.u_assignment_gorups = current.u_assignment_gorups+'>'+current.assignment_group.getDisplayValue();
}else{
	current.u_assignment_gorups = current.assignment_group.getDisplayValue();
}
})(current, previous);

 

Thanks,

Anil Lande

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

View solution in original post

6 REPLIES 6

Please correct if any typo errors and use your field names as per your configurations.

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

WORKS SO PERFECTLY. THANK YOU SO MUCH