Twilio/Notify - How to Link Incoming SMS with GlideRecord

DebjitGhosh
Tera Contributor

Hi All,

 

I am trying to implement On-Call Scheduling using Twilio - Notify. Now the requirement is if there's a P1 in the queue then the On-Call person will receive a SMS and Call, Where they need to acknowledge else the flow will move to the next person in the escalation matrix. Now for Voice Call I can find an OOTB subflow 'On-Call: Assign by Acknowledgement' which is triggering a call with the text-to-speech and asking users to press either 1 or 2 to to assign the ticket to themselves or move to the next person. Same feature is there for emails using 'On-Call: Assign by Email' which triggers an email to on-call person and they can reply to the email with ACC or REJ which will do the same job.

 

But firstly, I am unable to find any Subflow that does the same for SMS. Now in system there's a subflow which is for inbound SMS where it checks the gliderecord it is linked with and assigns the user to that ticket. Also using the 'Send SMS' flow action I am able to send an SMS which is linked with an incident. But when the user is responding with ACC that inbound SMS is not linked to the same record.

 

DebjitGhosh_0-1778235115943.png

Is there any way I can link the inbound SMS with the same record? Need help!!

 

Regards,

Debjit Ghosh

2 REPLIES 2

Naveen20
ServiceNow Employee
Inbound SMS replies land on the notify_message table but Notify doesn't natively correlate them back to the outbound task.
Linking the inbound SMS: On the Notify Number Group, set the Incoming SMS workflow (legacy workflow, runs on notify_message). Inside it you have current.body and current.phone_number. To find the originating task, GlideRecord the most recent outbound notify_message to the same phone number — outbound rows carry a source reference back to the task (verify the exact field on notify_message in your instance).
More reliable - put the incident number in the outbound SMS body (e.g., "Reply ACC INC0010001"). Parse current.body with a regex and GlideRecord the incident directly — no correlation, and it survives if the user replies late.

Niclas
Tera Guru

The subflow "On-Call: Assign by Acknowledgement" will only send the Notification to the channel for which the User has actually activated On-Call, if you are not getting SMS despite Notify is set up with Twilio - check first if you have enabled SMS as contact preference for your User. 

Technically you can modify the SMS sending - including the Flow used for it via the corresponding record in this table: on_call_communication_channel_config, but it should work out of box. 

In order to process the response you need to go the notify_number table and locate the number that is used for SMS Sending, it should have the field "Notify Group" set to "On-Call Group".  Open this Notify Group, there check the field to use Subflow and select On-Call: Check Assignment Response Incoming  within SMS Subflow field. This is the out of box subflow to process SMS response.

 

As long as you only need one SMS number to send SMS this out of box setup should be fine. If you need multiple to send SMS to multiple countries based on the recipient, it will become more tricky as you may need more than one Sender Number to reach those countries due to country specific local regulations. 

 

Please note: Subflow for On-Call are only available starting with Zurich, previously only legacy Workflows were available.

EDIT: Also don't forget to set up a Trigger Rule - as this is the correct way to initiate On-Call Escalation