Unable to send SMS messages from On-Call Workflow

bradwestvig
Giga Guru

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?

1 ACCEPTED SOLUTION

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.


View solution in original post

9 REPLIES 9

bradwestvig
Giga Guru

Update: I looked at the workflow context there is this message.



the result of the advanced script did not return a valid object (expected: {notify_number: ''...sys_id...'', users: [...], groups: [...], numbers: [...]})


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.


Hi Michael - which workflow or script is the "Send SMS" Related Link looking at? Will it look at whichever Outbound SMS Workflow you define, and if so, how would   this link know which Notify Number group to use I'm looking at the same configuration that Bradley is, but want to find the specific script/workflow action that is being called so that I can append "+1" to it to prevent having to manually update hundreds of phone numbers that aren't E.164. They come in a consistent (555) 555-5555 format.



Looking forward to your response.


Conor, the Send SMS and Initiate Conference Call related links on any task use the glide.notify.task.phone_number system property to know which Notify number to use:


Send an SMS message from a task



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.   However you can define a workflow to govern the workflow of an outbound SMS message.   You can set that in the Notify Number Group associated to the number in the glide.notify.task.phone_number system property.



Regarding updating your numbers you could do that via a Fix Script or background script.   You can change the phone number field on your user record to be of type Phone Number (E.164) and this will help make sure the numbers get entered correctly.   This field is linked with the location record associated to the user where location has a Phone Territory field that designates which format to use.



You can also update your transform maps to make sure they are in E.164 format too.