Monthly on-call rotation interval

Maria DeLaCruz
Tera Guru

Hello,

I need some help setting up an on-call schedule with a monthly on-call rotation interval.   This means, one person is on-call for a whole month, then the next person takes over on the 1st of the following month.   I've tried using a schedule span from the 1st to the 31st of the month, and then repeat monthly on day 1, but it doesn't seem to work for months that don't have 31 days.

Please advise.

Thanks,

Maria

4 REPLIES 4

andrew_och
ServiceNow Employee
ServiceNow Employee

The problem is that the rotation cycle is calculated and as such there is no simply formula to multiply people by days of rotation cycle when it comes to months. Setting the 30th will not only result in an empty day on the 31st, but also result in an overlap in February to March.



One solution is that you would setup up the first to the 28th of each month as follows



Repeats: Monthly


When: First of month 00:00:00


To: 28th of month 23:59:59


Repeat every: number of people in roster, e.g. 3 if you have three people in the roster.



Then stagger each member's start date by one month.



Finally for the missing days: 29th to 31st, on the months affected, you would need to manually create extra coverage. Understandably its not an ideal solution due to the potential amount of manual intervention, but results in an On-Call rota that would meet your requirements.


humblecommitted
Kilo Guru

Hello community,



I have found a solution.



Per the following website:


http://wiki.servicenow.com/index.php?title=Creating_On-Call_Schedules#gsc.tab=0



It recommend the following.


find_real_file.png




So here is how I did it.




find_real_file.png



find_real_file.png





find_real_file.png



find_real_file.png






find_real_file.png



find_real_file.png


or similarly


find_real_file.png




find_real_file.png



find_real_file.png



find_real_file.png



find_real_file.png



Then I created a trigger rule to assign the on call person too:


first i made a copy of the assign oncall work flow:


find_real_file.png


I did add this set values just in case no one was on call for some reason:


find_real_file.png




and made a trigger:


find_real_file.png




And associated the trigger to my newly created oncall assign workflow:


find_real_file.png



then it would assign when the alert/incident is created on the table:


find_real_file.png




I hope this helps!!!



Sincerely,



Humble Committed Student


Code update for newer ServiceNow release, Helsinki and Istanbul.


find_real_file.png


find_real_file.png


answer = ifScript();



function ifScript() {


                              var rota = new SNC.OnCallRotation();


                              var gdt   = new GlideDateTime();


                              //var escalationPlan = rota.getEscalationPlan(groupSysId, gdt);


                              //var escalationPlan = rota.getEscalationPlan(vars.assignment_group.sys_id.toString(), gdt);


                              var escalationPlan = rota.getEscalationPlan(current.assignment_group.sys_id.toString(), gdt);


                             


      if (JSUtil.nil(rota) || JSUtil.nil(rota.getCurrentRotaID())) {


return 'no';


      }


      return 'yes';


}



Click on the Run Script to update it.


find_real_file.png


find_real_file.png


  1. gs.include("OnCallRotation");

//Get the assignment group from the input variable


//Assign the incident to right on-call resource



var rota = new OnCallRotation();


//rota.who(workflow.inputs.assignment_group);


  1. rota.who(workflow.inputs.assignment_group.toString());  

var currentOnCall = rota.getPrimaryUser();



  1. workflow.scratchpad.assignment_group_id = workflow.inputs.assignment_group;
  2. workflow.scratchpad.current_on_call_id = currentOnCall;


//Only assign if there is someone is on_call & assigned_to is empty


if(currentOnCall && current.assigned_to.nil()) {


                              current.assigned_to = currentOnCall;


                              current.comments = gs.getMessage("DHS Alert has been assigned based on current on-call resource");


                              current.update();


                              gs.log("This is the output for currentOnCall: "+currentOnCall);


                              gs.eventQueue("dhs.alert.via.email", currentOnCall, currentOnCall.email, currentOnCall.name);


}


RAHUL Khanna1
Mega Guru

Hello, I have a different requirement, is it possible for you to provide a approach , The links is below

 

https://community.servicenow.com/community?id=community_question&sys_id=47008efbdbfd44d06064eeb5ca96...

 

Thanks in advance.