On-call scheduling - How to send multiple reminders for the on-call scheduling rotation instead of only one?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2018 07:17 AM
Details: Our company is using multi-provider SSO. It is my understanding (based on the documentation) that we can't use the on-call calendar subscription URL because basic authentication is still required to subscribe with the URL. So, we would like to configure the system to send more than one reminder via email notification. We are only allowed to enter one value in the 'Reminder lead time (days) field. What is the best way (recommended) to trigger additional reminders? For instance, we might want to send a reminder on the 30 day, 3 day, and 0 day marks.
Based on a response from ServiceNow support, I learned that on-call scheduling reminders are triggered by a scheduled job "On-Call Reminders" that runs daily. This scheduled job makes the following call:
```
new OnCallRemindersNG().sendReminders(null);
```
Looking at "OnCallRemindersNG" script include, I can see the "sendReminders" method code:
```
var reminderLeadTime = (JSUtil.notNil(rotaGR.reminder_lead_time) && (rotaGR.reminder_lead_time >= 0)) ? rotaGR.reminder_lead_time : 2;
this.log.debug("[sendReminders] rota reminderLeadTime: " + reminderLeadTime);
var rosterIds = [];
var rosterGR = this.getRosterGr(rotaGR.getUniqueValue());
while (rosterGR.next()) {
if (!rosterGR || rosterGR.rotation_start_date == "00000000")
continue;
if (JSUtil.notNil(rosterGR.reminder_lead_time) && (rosterGR.reminder_lead_time >= 0))
reminderLeadTime = rosterGR.reminder_lead_time;
```
They stated, I would need to customize this part of the code to loop through all your reminders. As an example, if you choose to have a list of days separated by semicolons, you can use javascript to split "rotaGR.reminder_lead_time" by ';" and then iterate through all of them to check if it applies."
My problem is that I do not have a lot of experience with scripting. I was hoping that someone may have already developed a solution for this requirement and would be willing to share the script with me OR offer me the guidance need to accomplish this task.
Thank you in advance!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2018 01:36 PM
Let's start with this line: Our company is using multi-provider SSO. It is my understanding (based on the documentation) that we can't use the on-call subscription URL because basic authentication is still required to subscribe with the URL.
We use SSO as well, and ITIL users can access the On-Call calendar without issues. So not following what issues you ran into?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2018 06:52 AM
Hi Michael,
Our ITIL users can access the On-Call calendar without issue. However, we are not able to use the calendar subscription URL (it sends an iCal link that enables users can subscribe to their on-call calendar from their preferred calendar client.)
Here are the URL and an excerpt from the documentation that I was referring to:
https://docs.servicenow.com/bundle/kingston-it-service-management/page/administer/on-call-scheduling/task/configure-on-call-calendar-subs-URL.html
This URL is sent as an iCal link that they can use to subscribe to their on-call calendar from their preferred calendar client.
Note: The subscription URL supports basic authentication. This means that the end user must provide their instance credentials to authenticate themselves to view their on-call events. Currently, only the Calendar application on Mac OS X 8.0 onwards and the Outlook application on Windows 2013 onwards support basic authentication for calendar subscriptions. If SSO is in use, basic authentication is still required to subscribe with the URL.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2018 07:03 AM
Ah . . . yes, not sure if there is a workaround on this feature yet.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2018 11:41 AM
I was able to set up a 2nd reminder on the on-call schedule with a 10 day lead time by completing the following steps:
1.) I made a copy of the OnCallReminderNG script include named OnCallReminderNG2
2.) In OnCallReminderNG2, I hardcoded the lead time variable to 10 - see screenshot
3.) I made a copy of the OnCallReminder Scheduled Job named OnCallReminder2
4.) In OnCallReminder2, I updated the job context to call OnCallReminderNG2 - see screenshot