OnCallRotation - getEscalateeAt(String groupID, GlideDateTime dateTime, Number position)

Gets an item to escalate to, either a user [sys_user] or notification device [cmn_notif_device], for a group's rota at the specified date and time and at a certain position in the escalation lineup.

The function returns null if an invalid position or group is passed as an argument.

You can use the getTableName() function to check whether the returning GlideRecord comes from the sys_user or cmn_notif_device table.

Table 1. Parameters
Name Type Description
groupID String The sys_id for the group from which to get the item to escalate.
dateTime GlideDateTime The date and time when the escalation lineup should begin.
position Number The position in the lineup to determine the item to escalate to (1-based, which means the count starts with 1).
Table 2. Returns
Type Description
GlideRecord The item to escalate to. Returns null if nothing is found.
var oncall = new SNC.OnCallRotation();
var escalatee = oncall.getEscalateeAt("287ebd7da9fe198100f92cc8d1d2154e", 
    new GlideDateTime("2013-11-26 09:00:00"), 2);
 
if (escalatee){
    gs.print(escalatee.getTableName());
    gs.print(escalatee.getTableName());
}