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

Nayan Mahato
Tera Guru

Hi Max,

To achieve this, you don't need to create multiple assignment group fields. You just have to add the below "Activities" formatted in the incident table form view and make sure to check "assignment group " in the filter activity. Once you are done with below the configurations, all the assignment group changes will be logged into the activity. Thanks.

find_real_file.png

 

 

Filter Activity- 

find_real_file.png

 

 

Regards,

Nayan

Hi Nayan! Thanks for your response. So much appreciated. 

I did this turned on for our users. However, users complaint that it's not clearly seen when they exported the list (incident_list.do) to excel. 

Any other ideas? 

Hi Max,

Yes, you won't be able to see these values in the incident list view. To see you can use the OOB "Metrics (metric_instance)" table.

Go to metric_instance table and look for the definition as "Assignment Group", you will see all the values of the assignment group field for a particular incident with time as well. Thanks.

 

Regards,

Nayan

 

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