Get on-call member from the on-call calendar

divvi_vamsi
Mega Expert

Hi,

We have an on-call schedule for a group "DB".   we'd like to get the current on-call person for the group "DB" via script for a given date. How would we achieve this?

Thanks
Divya

1 REPLY 1

Aditya Mallik
ServiceNow Employee
ServiceNow Employee

Below is a sample script you can run to get who is currently on-call for a given group id:



var onCall = new OnCallRotation();


gs.debug("Who: " + onCall.who("287ebd7da9fe198100f92cc8d1d2154e"));


gs.debug("Primary User: " + onCall.getPrimaryUser() + "; " + onCall.getPrimaryUserName());