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

Christine A1
Mega Expert

have you assigned a schedule per user? how are you spawing the rota instance, via SLA or auto assignment?

soumyamitra
ServiceNow Employee
ServiceNow Employee

The rota that you are using should be active (within schedule) at that time. Else whoIsOnCall will return empty results. rota is optional param. You should be fine with sending group in request only. Based on the time of call you will get Rota1 or Rota2 in output.

Thanks

Soumya

Isaac3
Kilo Contributor

The issue is that BOTH rotas are active at the same time because the members are supporting different applications.

So both ROTA_1 and ROTA_2 are covering 00:00 - 23:59 every day for example.

 

whoisoncall only returns data for ROTA_1.

If I delete ROTA_1 then query ROTA_2 data is returned.

It looks to me like the code behind it, OnCallRotation, can't cope with teams having multiple concurrent active rotas.

I've tried:-

There are 4 arguments that can be passed :-

group_id,rota_id, roster_id and date.

I've tried all possible combinations and if there's more than one active rota ... only get data back for the first.

 

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