Limit Number of on-call SMS Notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 09:04 AM - edited 01-05-2024 09:06 AM
We have a requirement from a number of support teams who state that the number of SMS notifications (and frequency) are inconvenient and unproductive.
I have scoured through ServiceNow Community posts that references "SMS", "text", "pages", "notifications", but nothing satisfied the requirements I need.
The basic ask: we need to be able to set X number of pages every Y minutes and up to Z number of pages (e.g. 1 page every 5 minutes with a maximum of 5 pages per incident) based on individual on-call group requirements. We currently use a slight variation of the out-of-the-box "On-Call: Assign" workflow that actually triggers the "Send SMS notification" workflow activity.
result = getRecipientsAndNumberToSendFrom();
/**
* Generate the object that will configure what number to send
* the SMS from and to what additional phone numbers or users
* the SMS should be sent.
*
* @returns {{notify_number: *, users: Array, groups: Array, numbers: Array}}
*/
function getRecipientsAndNumberToSendFrom() {
var recipientsDetails = {
notify_number : getNotifyNumber(), // the sys_id of the notify number
users : [], // array of user ids
groups : [], // array of group ids
numbers : [workflow.scratchpad.smsPreference] // array of E164 compliant phone numbers
};
return recipientsDetails;
}
/**
* Function to determine the Notify Number to call from
*
* Note, THIS LOGIC SHOULD PROBABLY CHANGE as it will
* return the first notify number which may not even
* be a SMS capable number.
*
* @returns {*}
*/
function getNotifyNumber() {
// if this workflow is running in the context
// of the call table, use the notify number
// associated
if (current.getTableName() == 'notify_call')
return current.notify_number;
var onCallNotifyNumberSysId = getOnCallNotifyNumberSysId();
if (onCallNotifyNumberSysId)
return onCallNotifyNumberSysId;
Any assistance would be greatly appreciated. Thank you.
- Labels:
-
Notifications
-
Workflow