How to send SMS to assignment group members when an incident is created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2025 06:45 AM
Hi All,
Greetings!!
We have enabled Twilio Spoke plugin to send SMS to assigned to and assignment group members when an incident is created.
I achieved this for assigned to easily by using send SMS action which is available OOB as part of Twilio Spoke plugin. Now i want to send SMS to assignment group members of incident record dynamically.
Kindly provide me some insights to achieve this requirement.
Plugin Enabled for Twilio:
Twilio Spoke(App id: sn_twilio_spoke)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2025 08:12 AM
are you accessing the correct script include and from correct scope?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2025 12:48 AM - edited 06-11-2025 12:49 AM
Hi All,
I am using notify API's which is mentioned in docs and send SMS to assignment group members of incident whenever priority incident is created.
Business Rule:
(function executeRule(current, previous /*null when async*/ ) {
gs.info("twilio inside");
var twilio = '+'; // This is twilio trial account number which I am using and passing as a parameter in sendSMS method. Removed for security reasons
var group = current.assignment_group;
gs.info("twilio" + group);
var gr1 = new GlideRecord('sys_user_grmember');
gr1.addQuery('group', "=", group);
gr1.query();
while (gr1.next()) {
gs.info("twilio inside while ");
var userPhone = gr1.getDisplayValue('user.phone');
gs.info("twilio userphone " + userPhone);
strMessage = "This is a test";
// Call Notify API to send the actual text
if (userPhone) {
gs.info("twilio inside if userphone ");
SNC.Notify.sendSMS(twilio, userPhone, strMessage, current);
gs.info("twilio reached end ");
}
}
})(current, previous);
I can see logs are coming till the end but no SMS is getting triggered.