Displaying who is the active on-call member from the calendar

Ben Cervantes
Kilo Expert

Is there a way to display who is the active on-call member from the calendar. For example we may have John Doe in Order position 3 and he is the active on-call member for the week but when we query the roster it will display who is in position 1 instead of who is truly on-call?

1 ACCEPTED SOLUTION

 

If you want to make an api call through script you can do like this - 

var request = new sn_ws.RESTMessageV2();
request.setEndpoint('http://localhost:8008/api/now/on_call_rota/whoisoncall?group_ids=0a52d3dcd7011200f2d224837e6103f2');
request.setHttpMethod('GET');

//Eg. UserName="admin", Password="admin" for this code sample.
var user = 'admin';
var password = 'admin';

request.setBasicAuth(user,password);
request.setRequestHeader("Accept","application/json");

var response = request.execute();
gs.log(response.getBody());

For more examples navigate to rest api explorer select an api call you can see examples
to attach them in the code like in the screenshot attached.


find_real_file.png

View solution in original post

5 REPLIES 5

srinivas007
ServiceNow Employee
ServiceNow Employee

Hi Ben Cervantes,

there is an API call named 'whoisoncall'. For your question you can provide group sys ids to the API call and it will return the details of the present active on-call member of that group.

 

Regards,

Srinivas. 

How would the function called be scripted is you could get me started with an example? 

 

If you want to make an api call through script you can do like this - 

var request = new sn_ws.RESTMessageV2();
request.setEndpoint('http://localhost:8008/api/now/on_call_rota/whoisoncall?group_ids=0a52d3dcd7011200f2d224837e6103f2');
request.setHttpMethod('GET');

//Eg. UserName="admin", Password="admin" for this code sample.
var user = 'admin';
var password = 'admin';

request.setBasicAuth(user,password);
request.setRequestHeader("Accept","application/json");

var response = request.execute();
gs.log(response.getBody());

For more examples navigate to rest api explorer select an api call you can see examples
to attach them in the code like in the screenshot attached.


find_real_file.png

I got it to work thanks!