Balance Work Load Using Round Robin Method in ServiceNow
Hello Guys,
Lets Suppose, You are Resolver and getting multiple Incidents/Issues daily and it is difficult for you to maintain the workload balance.
Also In your Organization there is no any procedure implemented to assign the coming incidents/Issue to the members of the Selected assignment Group.
So, Here I have a Solution which is "Round Robin Method" to assign the Ticket to a Resolver Automatically based on the Last Assigned Ticket Time.
Lets Start,
1. Create a Date/Time type of field on User('sys_user') table "Last Assigned Ticket Time".
2.Create a After-Insert Business Rule on Incident Table.
3.Condition - Assignment Group is not Empty.
Here is the Code.
(function executeRule(current, previous /*null when async*/)
{
var grmem=new GlideRecord('sys_user_grmember');
grmem.addQuery('group',current.assignment_group);
grmem.orderBy('user.u_last_assigned_time');
grmem.query();
if(grmem.next())
{
current.setValue('assigned_to',grmem.user);
current.update();
var gruser=new GlideRecord('sys_user');
gruser.addQuery('sys_id',grmem.user);
gruser.query();
if(gruser.next())
{
gruser.setValue('u_last_assigned_time',gs.nowDateTime());
gruser.update();
}
}
})(current, previous);
Note- I implemented this Solution on my PDI, So if anyone is trying to implementing the same and faced any issue ,please let me know I would like to help them.
Also If you like the Content and Article, Please Like it and Bookmark it, which will encourage me to create more good article on new topics.
Thanks & Regards,
Yash K.Agrawal
Certifed Servicenow Developer
https://www.servicenow.com/community/developer-articles/balance-work-load-using-round-robin-method-in-servicenow/ta-p/2316608