Auto Assign Assignment Group based on Time of Day (Schedule)

cmcdevitt1
Kilo Contributor

We would like to auto assign incidents to assignment groups based on the time of day (and CI of course). A kind of follow the sun approach. Has anybody done this and how did you implement it?   I was looking at the "Assignments" module, but there was no OOB concept of schedules.

Thanks in advance for your input.

Chris

8 REPLIES 8

tdf
Kilo Expert

Have you taken a look at On Call Scheduling?   http://wiki.servicenow.com/index.php?title=On-Call_Scheduling



-tim


cmcdevitt1
Kilo Contributor

Tim,



I must be missing something.... I checked that out and it did not mention anything about changing 'assignment groups', just people rotating people in the assignment group.


I could have sworn that did both.   Apologies for sending you down a rabbit hole.   Looks like Doug's is going to be your best solution.   Just as an improvement on this obviously you'll want to build a custom table to do lookups from on that and then use a script include for your logic. That way you can use it from incident and workflows (and wherever else you might want to).   As an aside, you might also want to think about an escalation level in there so you can use the same functionality for some of your hierarchical escalations. . . food for thought.



-tim


randrews
Tera Guru

you can also do this using a schedule.. we had a requirement in a catalog item.. if it was in business hours when the task was created to send to one group and outside business hours to send to a different group... we created an if script to check this as follows



_____________________




/* ----------------------------------------------------------------------------------------


Query the schedule table for the 8-5 weekdays excluding holiday schedule. Take the


current datetime plus 15 minutes and check if it's during or after business hours in


the Pacific time zone.


--------------------------------------------------------------------------------------- */



answer = ifScript();



function ifScript() {


      var schedRec = new GlideRecord('cmn_schedule');               // Query table for schedule


      schedRec.get('8-5 weekdays excluding holidays');       // Get the schedule name


      var sched = new GlideSchedule(schedRec.sys_id);               // Create variable schedule


      var schedTime = new GlideDateTime();                       // Create variable current datetime


      schedTime.addSeconds(900);                                       // Add 15 min to variable datetime



      // If datetime during business hours Pacific time zone


      if (sched.isInSchedule(schedTime,'US/Pacific')) {



              // Route task to Data Center


              //gs.addInfoMessage('In schedule - Route to Data Center');


              return 'yes';


      }


      // If datetime after business hours Pacific time zone


      else {



              // Router task to Command Center


              //gs.addInfoMessage('Not in schedule - Route to Command Center');


              return 'no';


      }


}