Round-Robin (Auto Assignment of new incidents and tasks)

magoo
Kilo Expert

HI All,

 

I was asked to create a round-robin type approach (Auto Assignment) for any incidents/tasks that come into our two level1 groups. What we are looking for is that if its sent to team A's group it will auto assign to the next team member in line, and same with Team B.   I have searched the forums and found a post back from 2008 but it had been deleted by ServiceNow in 2010.   Our company is new to ServiceNow (a couple months now), and I am guessing this is more of a script that would need to run, but currently do not have much experience in scripting.   Has anyone had any luck with doing something like this?   Any suggestions would be greatly appreciated!

 

Thanks!

1 ACCEPTED SOLUTION

justin_drysdale
Mega Guru

We have this in our instance.   Here's the breakdown:



On sys_user, create a date/time field to track last ticket assigned. Also create a checkbox that will be used to determine if the user can receive a ticket.   This can be your vacation exclusion logic.



1. Make an array (associative, key-value) to contain your users that will receive tickets and their corresponding last ticket assigned timestamp.


2. Find your assignment group, and query it's users.


3. Push those users and timestamp into the user array from 1.   You can conditionalize here with the checkbox to make sure you are only pushing 'active' users into the array.


4. Sort the array by timestamp, return the user that has the oldest timestamp.


4.5. Update the user's timestamp.


5. assigned_to = returned user.



Please let me know if you have any questions.


View solution in original post

102 REPLIES 102

Hi ,



Thanks for posting this - its pretty awesome!



I have been playing around with this in my DEV instance and I think that it is working fine for me. But I have an issue when bulk tickets are assigned to Help Desk queue. Let me explain you clearly suppose only 2 agents are in shift and a bulk of tickets (50+) assigned to Help Desk queue. All those tickets will get assigned to agents who are in shift but it is not possible to handle all those tickets by end of the day. Also, the other agents who will come in other shifts have to sit ideal if there are no tickets in queue.   So I was thinking of limiting the tickets to 10/20 per agent. I mean if the number of tickets assigned to an agent is greater than 10, tickets should not assign to that agent. Those tickets should be in queue and assigned to the agent who logs in next.



I hope you understand.



Any help is greatly appreciable.



Thanks


Nani


Yes, you could set a limiter on it in a number of ways:


  1. Code a max ticket-per-hour for round robin auto-assign
  2. Create a "bulk" group and have rules in place
  3. Don't have them auto-assigned on the trigger of assignment group change... instead create a scheduled task to run every 5 minutes that will run the auto-assign feature, and limit it to 5 tickets per agent / tech.


There are many ways you can alter the logic.   Since the code is all there for you, dive right in!  


Hi David Dunn,


Thanks for your response. I am new to coding world. Would you mind providing the script?



Any help is greatly appreciable.




Thanks


Nani


Hi David Dunn,



In the document/steps explained here, does not contain the   code to update "u_daily_tickets_assigned" field of "u_round_robin" table.


Only in the "adminDisableRR" function we are updating the round robin table. Apart from that none of the place we are updating round robin table.



In all the places we are updating sys_user table only.



After following the document/steps given here, this is how my widget looks,



rr-issue-for-forum.png



Am I missing anything or it is not given here?



Thanks


Prici


Pricilla, I have since completely re-written this Round-Robin feature.   It no longer sits on the sys_user table, and is much more enhanced with a ton more features and code optimizations.



The new look(s):



find_real_file.png






find_real_file.png



I will try to get all this new data consolidated and uploaded, fully documented.