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 Mark,



The true/false checkbox is a variable added to sys_user.   The business rule runs whenever there is a ticket assigned to the Service Desk without a assigned to.   So it runs pretty much constantly since many of our inbound actions assign a record to the Service Desk.   Previous to the round robin we had some 'cherry picking' going on.



I setup a ui page for the SD Manager and SD Lead that toggles the value of the checkbox and makes it easy for them, but this is unnecessary.   Whenever a technician calls in sick or goes on holiday the Manager or Lead can toggle their ticket assignment checkbox.



Since we went to Calgary I had to make a change to the script... the gs.sleep(3000) on line 1 should be moved to directly after line 26.   We experienced an outage and noticed that one tech was getting too many tickets.   Moving the sleep to just after:


updateDateTime(tech_arr[0].sys_id); //updating ticket last assigned date  




resolved the issue as it gives the system time to update the last ticket assigned date.




I've made a few improvements to the script since this was posted... it now routes T1 issues ('lockout', 'toner', etc) to our T1 techs.   It also localizes assignment based on requested_for.   Ex: requested_for location is 'East Coast' so the script routes the ticket to a tech whose location is also 'East Coast'.  




Thanks.


You could enable the On-Call Plug-In and make it run during business hours.



I enabled and configured this for after hours, but there is no reason you could not utilize during business hours.



Group On-Call Rotation - Versions Prior to Eureka - ServiceNow Wiki



Category:On-Call Scheduling - ServiceNow Wiki


Hey Johnny,



  Could you elaborate as to how you are using the On-Call schedule to tell the script above that a Service Desk Agent is "on shift" and available for ticket assignment?   I was looking to do this too.   Give our Service Desk scheduler the ability to set up the work schedules for a 24x7 service desk group that depending on the shift, people come on and off of Assignment Availability.


I'm working on the Auto assign piece and have it working fine, but as justin.drysdale said above, we're relying on a bit flag on the sys_user to tell whether or not the Service Desk agent is working at that time.   Any help would be greatly appreciated.



Thanks!


Cal


I was able to use Schedules and a Scheduled job against the user table with some bit flags.   Work perfectly for our Service Desk.   We can now have a single group of Service Desk agents with different schedules be auto-assigned tickets when they are "On Shift"   The Scheduled job checks to see if they are on shift and then makes them available for ticket assignment. The Round Robin piece takes care of who is next in line for a ticket.


This is the same thing I did for our Service Desk. I also decided to create a module for the Service Desk Manager in the CMS that displays all of the Service Center Technicians status, tickets assigned by day, week, and month. It also includes buttons for the Service Desk Manager to change the Status of any Technician on the fly as well as view all of the tickets currently assigned to that Technician. Here is a screenshot...


TEST.PNG