Dynamically Setting Recipients List Based on On-Call Schedule

Not applicable

Requirement: Dynamically Setting Recipients List Based on On-Call Schedule to send out an SMS on the Major Incident Workbench.

 

Current Script: 

(function() {
    var currentTime = new GlideDateTime();
    var recipients = [];
    var groupSysId = current.assignment_group.sys_id;
    //var groupSysId = 'f71dfc0a1b2efc10c59b43f4bd4bcbdf';

    var onCallRotation = new global.OnCallRotationSNC();
    var rotationMembers = onCallRotation.getEscalatees(groupSysId);
    var userIds = rotationMembers.map(function(item) {
        return item.userId;
    });
    // gs.log(JSON.stringify(userIds));
    return {
        'internal': userIds
    };


})();

If I put in the static assignment group the script pulls in the correct sys_id of the users on-call. I'm having trouble identifying how to pull in the "Current" assignment group on my Dynamic Condition. Has anyone done this before?

5 REPLIES 5

Not applicable

Does anyone have any idea on this?