whoisoncall

Isaac3
Kilo Contributor

I'm using the scripted api whoisoncall to return the current oncall person for a group successfully.

We have a team that has multiple active rotas.

So .... A particular Team has 2 rotas we'll call this "A_TEAM"

ROTA_1 has users A,B,C,D in a rota for Application P

ROTA_2 has users W,X,Y,Z in a rota for Application R

https://my.service-now.com/api/now/on_call_rota/getrotasbygroup/<A_TEAM_SYS_ID>

returns (as expected) :-

{
  "result": [
    {
      "name": "ROTA_1",
      "sys_id": "3ed69121db72ebc0695ef2eb0c961968",
      "group_sys_id": "54dd2a24db1b93c06631f2eb0c961952"
    },
    {
      "name": "ROTA_2",
      "sys_id": "81c9e125db3aebc0695ef2eb0c961963",
      "group_sys_id": "54dd2a24db1b93c06631f2eb0c961952"
    }
  ]
}

If I perform whoisoncall for ROTA_1 .....

GET https://my.service-now.com/api/now/on_call_rota/whoisoncall?rota_ids=3ed69121db72ebc0695ef2eb0c961968

returns (as expected) :-

{
  "result": [
    {
      "memberId": "027f51a1db76ebc0695ef2eb0c961997",
      "userId": "05ad00b9db711b006631f2eb0c96192b",
      "roster": "bad69121db72ebc0695ef2eb0c96196f",
      "rota": "3ed69121db72ebc0695ef2eb0c961968",
      "group": "54dd2a24db1b93c06631f2eb0c961952",
      "deviceId": "",
      "isDevice": false,
      "order": 1,
      "isOverride": false,
      "rotationScheduleId": "76d69121db72ebc0695ef2eb0c96196a",
      "memberScheduleId": "067f59e1db76ebc0695ef2eb0c96193a"
    },
If I perform whoisoncall for ROTA_2 .....

GET https://my.service-now.com/api/now/on_call_rota/whoisoncall?rota_ids=81c9e125db3aebc0695ef2eb0c961963

{
  "result": []
}

Using the GUI .. both rotas show someone oncall.

If I delete ROTA_1 ..., whoisoncall for ROTA_2 returns as expected.

It would seem to me that whoisoncall can only cope with one rota being 'time active' at anyone time for a group.

 

1 ACCEPTED SOLUTION

soumyamitra
ServiceNow Employee
ServiceNow Employee

Both Rotas being active at the same time was not supported pre-Madrid. Rota time Overlap was not allowed. We might have a customization in place to relax the validation on your instance.

 

However, we have received this requirement and concurrent Rotas will be supported in Madrid (upcoming release) onwards.

 

Thanks

Soumya

 

View solution in original post

5 REPLIES 5

Thanks alot for confirming my thoughts