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

Wes Farmer
Kilo Contributor

Ah ok.   I noticed this in your initial PDF....does this take additional customization then?   I see the list currently on my UI page, however don't see the Disable buttons, etc...



find_real_file.png


Hi David,


One final question here....we have implemented and is working well.   I assume the trigger group 2 is for if we want to do Round Robin on a 2nd assignment group?   If so, is all of that functionality already built into the script and ready to use, or do we need to make modifications to use the 2nd group?   Thanks!


Correct, trigger group 2 is exactly for that... however, it's ~half implemented.   For my specific environment, I ran into an issue getting it fully coded in (probably easy to overcome) that I didn't have time complete.   Depending on the urgency you have for this feature, either you can wait for me to get it fully implemented or you can code it to work in your environment.   It's certainly something I planned on finishing.


Wes Farmer
Kilo Contributor

Hi David,


Thanks for the update.   It certainly is not urgent for us (and I have plenty of other more pressing items) and I think I could wait if you have plans to finish it.   Is there a way I could stay in the loop to find out once you have finished, or just keep checking this discussion?   Thanks!


Also don't forget to make sure that Trigger Group 1 field is filled in with Service Desk.