NotifyUtil - Global
-
- UpdatedJan 30, 2025
- 6 minutes to read
- Yokohama
- API reference
The NotifyUtil script include provides utility methods to use when interacting with Notify calls and SMS messages using server-side scripts.
To use this script include you must activate the Notify (com.snc.notify) plugin.
Using the NotifyUtil script include you can:
- Obtain all of the Notify telephone numbers and related Notify information from a specified source record.
- Obtain a list of unique Notify telephone numbers.
- Determine whether there are any active conference calls for the specified source record.
- Obtain the SMS-capable number associated with the specified Notify user.
- Validate a specified Notify telephone number.
NotifyUtil - NotifyUtil()
Instantiates a NotifyUtil class object.
Name | Type | Description |
---|---|---|
None |
Example
This example instantiates a NotifyUtil object.
NotifyUtil - getListOfNotifyNumbersAndProviders(String sourceTable, String sourceSysId, String notifyGroupSelectorSysId, Boolean filterSMSCapableNums)
Returns all of the Notify telephone numbers and related Notify information from a specified source record, such as an incident.
You can use this information to initiate a call or send an SMS message on a particular source record. The information that is returned is based on the configuration of the Notify Provider Selector framework. For additional information, see Notify
Example
This example shows how to obtain the Notify telephone numbers and related Notify information from a specified source record.
NotifyUtil - getSMSNumberForUser(String userGrOrId)
Returns the SMS-capable number associated with the specified Notify user.
Name | Type | Description |
---|---|---|
userGROrId | String or GlideRecord - Global | Sys_id of the user record, Table: User [sys_user] table or the sys_user GlideRecord of the user for whom to return the SMS-capable telephone number. |
Type | Description |
---|---|
String | User SMS-capable telephone number. Returns null if the specified user is not found. |
Example
This example shows how to obtain an SMS-capable telephone number using the associated GlideRecord.
NotifyUtil - getUniquePhoneNumbersForUsersAndGroups(Array numbers, Array users, Array groups, String type, Boolean getData)
Returns a list of unique Notify telephone numbers.
If you don't pass any parameters in the call, all Notify numbers within the Notify Phone
Number [notify_number] table are checked for duplicates, with each available phone number
only appearing once in the returned list. You can refine the return results by specifying a
list of users or groups to check, or by specifying a set of numbers or number types (SMS or
voice.) You can also request that the metadata associated with each number be returned along
with the unique numbers. If you do not want to use a parameter, simply pass
null
as a placeholder. For example: return
nUtil.getUniquePhoneNumbersForUsersAndGroups(null, userIds, null, 'sms',
false);
.
Example
This example shows how to request a specific set of unique Notify telephone numbers that have SMS capabilities.
NotifyUtil - hasActiveConferenceCalls(String sourceRecSysId)
Determines whether there are any active conference calls for the specified source record.
Name | Type | Description |
---|---|---|
sourceRecSysId | String | Sys_id of the record to check for active conference calls. For example the sys_id of a record in the Incident table. |
Type | Description |
---|---|
Boolean | Flag that indicates whether the specified record has associated active
conference calls. Possible values:
|
Example
This example displays an information message if there are any active conference calls associated with an incident record.
NotifyUtil - validateOutboundNotifyPhoneNumber(String number)
Validates a specified Notify telephone number.
- Whether the Notify number exists in the Notify Phone Number [notify_number] table.
- Whether the Notify number has a Notify group associated with it.
- Whether the Notify number is active.
Name | Type | Description |
---|---|---|
number | String | Notify number to validate. |
Type | Description |
---|---|
None |
Example
This example illustrates how to validate a notify number.
NotifyUtil - validatePhoneNumber(String number)
Verifies that the specified number is a valid E.164 telephone number.
Name | Type | Description |
---|---|---|
number | String | Telephone number to validate. |
Type | Description |
---|---|
Boolean | Flag that indicates whether the specified number is a valid telephone
number. Possible values:
|
Example
This example illustrates how to validate a telephone number.
On this page
- NotifyUtil - NotifyUtil()
- NotifyUtil - getListOfNotifyNumbersAndProviders(String sourceTable, String sourceSysId,
String notifyGroupSelectorSysId, Boolean filterSMSCapableNums)
- NotifyUtil - getSMSNumberForUser(String userGrOrId)
- NotifyUtil - getUniquePhoneNumbersForUsersAndGroups(Array numbers, Array users, Array
groups, String type, Boolean getData)
- NotifyUtil - hasActiveConferenceCalls(String sourceRecSysId)
- NotifyUtil - validateOutboundNotifyPhoneNumber(String number)
- NotifyUtil - validatePhoneNumber(String number)