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

saksham2
Kilo Contributor

Hi,


I am using this to implement round robin functionality.


Can you explain what the scheduled job : Round Robin unpause after 15 mins is doing.



I performed all steps as mentioned in the attached zip file (Code)



I tried to test by creating new incident with assigned to   = empty and assignment group = Service Desk


but he incident didnt get assigned in a round robin fashion.



Am I missing on some prerequisite or steps here ?




My tables (u_round_robin ,u_round_robin_users_and_options have no data)


Do I need to add these manually for users of Service Desk ?



Also my requirement is that a ticket should be configured for round robin assignment after 30 mins of opening the ticket,


eg: if ticket is opened at 8:00am the auto assignment should start at 8:30am so that there is half an hour buffer time.


Can you suggest how I can incorporate this ?



This is urgent for me and I would appreciate any inputs or suggestions.


davidd. prici gareth.price



Thanks,


Saksham.


Wes Farmer
Kilo Contributor

Hi David,


I downloaded the latest code you provided and created all the required components, but when I try the UI page it just sits at "....loading data, please wait".   Wondering if there is something obvious I am missing here?


If you inspect the DOM, is it throwing any errors?


Wes Farmer
Kilo Contributor

Nothing on the HTML code.   I do see an error on the client script on line 536.   Attaching error....



find_real_file.png


Yes, that is common.   It's because of "white spaces" as described here:   too many errors . 79 % scanned



There's a different issue you're having.