- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2014 04:25 AM
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!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2014 03:07 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2017 06:47 AM
Thank you David Dunn,
It would be really helpful if you are sharing the latest document.
Regards
Prici.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2017 01:15 PM
Please see attached Code.zip file.
You will see within the file, a structure like this:
All the .js files is the actual code, and the images are screenshots of important "structure" info for each.
The most difficult (time consuming) manual work you have to do is create the tables and columns.
Let me be clear on something else too: our Round Robin is for our "Service Desk" group. If your group is named something other than "Service Desk", change the name of it where the code makes reference to it. There are several spots.
I also included an excel dump of my u_sprite_coords table, (located in Tables->u_sprite_coords). The sprite sheet consists of slightly over 817 images, so after you create your u_sprite_coords table, you can import the u_sprite_coords.xlsx file and do a transform map instead of entering all 817 records by hand
I'll leave it at that. Download and unzip the attachment, implement this into your system (preferably your dev environment first), and reply back if you have any questions and/or issues.
I believe I've covered it all in the file, but I'm sure you'll let me know if something is missing or not explained enough.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2017 03:52 AM
Thanks a lot David Dun,
Will give a try and post the update.
One Query David,
Whether the new implementation is Generic ?
If i want to implement Round Robin feature for more than 5 groups,
Do I need to create all function again separately for the other groups?
Currently I have implemented this for 2 groups. So I have created 2 tables to have group members & ticket assignment details.
Created new Table,add1,ttftd1 & gettimeval1 function.
Now I need to implement Round Robin for 7 more groups.
How can I make it generic to work for 'n' number of groups with minimal changes..
Please advice.
Thanks
Prici

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2017 11:42 AM
We never had the need for multiple groups, so I never considered coding it in. It's certainly possible, but would require a complete code rewrite.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2017 04:18 AM
Sure David Dunn,
Thanks for your response.
Actually I have implemented Round Robin for 8 more groups now by creating Business Rule,UI Page & Widget separately for all.
Am not sure it is a right way to proceed, but its working actually.
I just need to know one thing that,
Since we have created BR for before insert/update, the auto assigned to is working.
If I want to assign it some one else, it is not allowing.
Lets say the auto assigned person is on leave & some one is going to work on that ticket (or) when I create ticket manually I need to assign this to a particular user.
Currently it is not allowing & it is randomly assigning it to user because of Round Robin.
Any idea to over write this..
Thanks
Prici.