Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

onCallRotation.getEscalatees function not returning on call members for specific shift

Saranya2
Tera Contributor

Hi All,

 

I am facing issue while returning on call members from specific shift. we have 2 shifts (shift A & Shift B) for a single group. I want to use only 1 shift (Shift A) and on call members from that shift in my logic. I have tried below code by passing group and shift (Shift A) as an argument, But it does not return anything. returning empty array []. if I am passing Shift B as an argument it is returning members.. But I need shift A , I am not sure what is the difference &I couldn't figure out the issue.. Can anyone please help me.. Thanks in advance.

 

Note: Both Shift A & Shift B have same members only order is different. 

 

var groupSysId = '8a5055c9c61122780043563ef53438e3'; // group sysid
var onCallRotation = new OnCallRotation();
var rota = '501ae7ada8812300964fb5fe74c31e3c'; // sysid of shift
var result = onCallRotation.getEscalatees(groupSysId, rota);
gs.log(JSON.stringify(result));

 

Thanks,

Saranya

 

5 REPLIES 5

Hi, I am not an on-call expert but I don't believe that having 2 concurrent 'shifts' would be a valid configuration. The purpose of on-call schedule/shifts is to identify a 'team' that is supporting XXX during any identified period in time, not 'teams' and I would not expect multiple shifts to be valid.

Definitions of On-Call Scheduling terms (servicenow.com)

Shift

A shift is the time period during which the members of a roster are on-call. You can view the details of any shift from the calendar.

Roster

A roster is a set of members that is on call for a shift. Because there is typically a roster for each escalation level (primary, secondary, tertiary), there are typically multiple rosters for a shift. The members of any roster are contacted in the order that is defined by the escalation policy.

Roster members (members)

The members of a roster are the users that have been added to a single roster. Roster members typically have the itil role. During an assigned shift, members must be available to act if notified of an escalation.
  • Users must be members of the same group.
  • The shift manager (rota_manager role) might or might not be a roster member.