
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2017 10:40 AM
I've been working on setting up a demo of Notify using the lab from last years Knowlege Conf. I'm able to send SMS messages directly from an incident using the send SMS button, but when trying to use the trigger work flow I get this message.
"- Could not contact Beth Anglin using phone number +XXXXXX (Unable to send SMS as the Notify Phone Number to send the SMS is not defined)"
Any ideas what config defines this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2017 09:34 AM
Hey Bradley! I actually lead the Advanced Communications lab last year and doing it again this year.
Out of the box the ON-Call workflows need to be configured to work with Notify. In the workflows you will find 1 or more SendSMS activities that need to be edited. Of course its best to copy out of the box code and make your own version.
You will see in the getRecipientsAndNumberToSendFrom() function it has the "notify_number:getNotifyNumber()" commented out. Basically Notify expects the SysID of the notify number to use for the SMS. So you can either uncomment this line or you can hard code a number. If you uncomment the line you may want to edit the getNotifyNumber() function towards the bottom to ensure it uses the right Notify number.
Important note: You need to make sure that the number you choose has a number group that has the incoming sms workflow set to On-Call: Check Assignment Response. I have personally combined this workflow with the Notify: Join Conference Call Via SMS so I don't have to use separate numbers for on-call and conference calls.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2017 09:48 AM
Thanks for the response. I understand that the Send SMS and Initiate Conf Call use the glide.notify.task.phone_number system.
Your comment "out of the box there are no outbound SMS workflows since SMS messages are generally just like an email where you need to send it" - if I update the outbound SMS workflow for my Number Group, will the "Send SMS" button leverage that workflow specifically, meaning that I could update that advanced script in that action to append "+1" to everyone's numbers? I specifically want to add +1 to whatever script or action the Send SMS is using and maybe I don't completely understand how it works.
The reason I'm hoping not to change the mobile phone field by default (and per your lab instruction) to e.164 field type is that during my testing, all the existing phone numbers when I switch that property turn to Other/Unknown by default because they are not already appended by +1 for North America.
Therefore, everyone's phone numbers currently formatted as (555) 123-4567 turn into +55 512 34567 or something unusual instead of getting +15551234567
I couldn't see an easy way to access the North America property in a script, or even via a broad list update to update everyone's properties easily so that all the phone numbers are turned to e.164 North America.
I also couldn't see an easy way to contact you directly as I don't want to hijack Brad's thread here. Look forward to continuing this conversation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2017 10:50 AM
Conor, I understand your challenges. Starting things out with E.164 are a bit easier but more difficult after the fact. Unfortunately there isn't a way to specify the phone territory via script like currency fields, but I have found the following works:
1. Run a background or fix script to mass update all of your user's phone numbers with the correct country code. Example for North America:
var userRec = new GlideRecord("sys_user");
userRec.query();
while (userRec.next()) {
userRec.mobile_phone = "+1 " + userRec.mobile_phone;
userRec.update();
}
2. Pull up the user record form and configure the mobile phone dictionary record and change the type to Phone Number (E164)
Upon step 2 all of the phone numbers will automagically be converted to E.164. Of course test this in your dev or test instance before production. Then be sure to update your transform maps to include the right country codes upon insert and update.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 08:01 AM
Hello @Michael Ritchie ,
I am getting same error as stated above can you help us with these.
We had a custom code:
SendSMSError: Unable to send SMS as the Notify Phone Number to send the SMS is not defined
Error: The result of the advanced script did not return a valid object (expected: {notify_number: ''...sys_id...'', users: [...], groups: [...], numbers: [...]})
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2017 04:43 PM
Can I piggy back off this one or should I open my own?
I copied the On-Call: Assign and Notify, just to demo/test out a POC for 'sending a sms / call from a workflow' to be part of a bigger notification / acknowledgement / escalation process ...
I am stumped now on the send sms bit.
I've pasted what I have for reference ...
I am very confused what is meant by "the sys id of the notify number" does SN come with a notify number? or do I have to setup twilio?
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() {
return {
notify_number : 1##########, //getNotifyNumber(), // the sys_id of the notify number
users : [current.getValue("assigned_to")], // array of user ids
groups : [current.assignment_group], // array of group ids
numbers : [1##########] // array of E164 compliant phone numbers
};
}
/**
* 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;
// get the first notify number - THIS SHOULD PROBABLY CHANGE!
var number = 1########## //new GlideRecord('notify_number');
//number.query();
//if (number.next())
return number//.getUniqueValue();
return null;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2017 05:14 PM
http://wiki.servicenow.com/index.php?title=Working_with_Notify#gsc.tab=0
Check out that resource, it helped me and I got Twilio trial account setup w/ the assign and notify workflow to send me a text if I am the person who is on call for the group that the incident was assigned to (based on the assignment group of the CI that the incident was logged against)