- 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
12-21-2016 11:37 AM
Hi David,
Thanks for posting this - it's pretty awesome! I have been using a different Round Robin very successfully for 3 years, but it is no longer functioning in UI16. I'm looking to migrate to a new solution and I think this is going to be it.
I have been playing around with this in my Dev instance, and I think that I have it working, but I'm running into one issue with the Round Robin Group that the widget displays. We do not have a group named "Service Desk", so I tried to change the widget to look for "Help Desk" instead. Within the 'roundRobin_functions' script include, I modified the gr1 sys_user_group query to be the below code:
gr1.addQuery('name', 'Help Desk');
When I do this, the widget table disappears.
If I switch the gr1 group query from 'Help Desk' back to 'Service Desk', the table appears again (even though there is no group named 'Service Desk' in my instance).
I have even tried changing the query to look for the Help Desk group's sys_id instead of the group name, but it yields the same results with the missing table.
Oddly enough, I tried a few other groups and discovered that this is only not working if there is a space in the name of an existing group, When I change the group query to a group without a space in the name, the table is displayed. And when I change the query to a group that doesn't exist (and the name contains a space, example: "Service Desk" or "Fake Group"), the table is displayed. The same also applies if I try using querying the sys_ids for groups with/without spaces in their names and for non-existing groups.
Any ideas on why the table wouldn't be displaying correctly for any sys_user_group that has a space in its name?
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2016 04:53 AM
Honestly I haven't a clue. I would say it's cAsE sensitive, but you tried by sys_id and it still didn't show. There must be something somewhere else. Is it possible that you share your script include so I can take a look?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2016 05:13 AM
I think I figured it out last night. I needed to add the u_last_ticket_assigned column to the sys_user table. I didn't see that step at all in your pdf instructions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2016 05:20 AM
Well call me a monkey's uncle.... I did forget that in the PDF. Nice catch!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2017 01:19 AM
Thanks David, your pdf was very helpful.
Best Regards,
Pritam