Automate and customize Slack tasks
Summarize
Summary of Automate and customize Slack tasks
This guide explains how ServiceNow customers can automate and customize Slack tasks using prebuilt configurations, inbound decisions, and subflows. It provides practical steps to automate Slack commands, message actions, posting approval messages, assigning requests based on acknowledgements, and posting actionable messages, enabling seamless integration and improved workflow automation between ServiceNow and Slack.
Show less
Automate Slack Commands
- Configure Slack commands in the Slash Commands page of your custom application.
- Create or customize subflows in Workflow Studio to handle actions such as creating incident records.
- Set inbound decisions in ServiceNow with conditions matching Slack commands (e.g.,
/now create incident <text>) to trigger corresponding subflows. - Examples of Slack commands include:
/now list incidents– lists active incidents assigned to the user/now help– displays available commands and usage/now note [note]– adds notes to incidents/now create incident [short description] > [urgency] > [impact]– creates incidents with specified details
Automate Message Actions
- Create Slack message shortcuts with a Callback ID (e.g.,
postmessagenow) in your custom Slack app. - Develop or customize subflows in Workflow Studio to process these message actions, such as creating incident records.
- Configure inbound decisions in ServiceNow matching the Callback ID to trigger the appropriate subflow.
Post Approval Messages
- Customize the default subflow
Respond to Slack Approval Actionto post approval messages on Slack channels. - Configure outbound configurations in ServiceNow with a unique Action ID (e.g.,
approvalrequest) to automate posting acknowledgment messages. - Set inbound decisions to detect this Action ID and invoke the configured subflow, which updates records and sends acknowledgment messages on Slack.
Assign Requests Based on Acknowledgement
- Copy and customize the
On-Call Assign by Acknowledgementsubflow in Workflow Studio. - Use outbound configuration with a unique Action ID (e.g.,
oncallassignbyacknowledgement) to automate assignment tasks. - Configure inbound decisions to trigger the subflow based on this Action ID and any additional conditions.
Post Actionable Messages
- Configure outbound messages with target tables, fields (e.g.,
shortdescription,priorityfrom Task table), and action buttons (e.g., Accept, Reject). - Use a unique Action ID (e.g.,
oncallassignbyacknowledgement) in outbound configurations for automation. - Create or customize the
Post Actionable Messagesubflow in Workflow Studio, providing the record’s SysID and selecting the appropriate message template. - Set inbound decisions to trigger this subflow when conditions match the Action ID and other parameters.
Automate Slack tasks as per your requirement, using the sample these scenarios as a reference.
You can use the default outbound configurations, inbound decisions, and subflows as reference to customize tasks as per your requirement.
Automate Slack commands
- Configure the Slack commands on the Slash Commands page of your custom application. For more information, see Configure Slack app.
- In Workflow Studio, create a subflow configure to create the
incident records as per your requirement or create a copy of the default subflow,
Respond to Slack Command, and configure it.Note:Create an action and use the payload in the subflow input as per your requirement.
- Configure inbound decisions in ServiceNow instance.
- In the Condition, ensure that you specify the value
of command as /now and specify
the required parameters.Note:You can specify up to 2 parameters in your condition to trigger the required subflow.
- In Answer, select the subflow you had configured.
- In the Condition, ensure that you specify the value
of command as /now and specify
the required parameters.
- /now list incidents to list all active incidents assigned to the logged in user.
- /now help to display all available commands and their describe usage.
- /now note [note] to add notes to the required incident.
- /now create incident [short description] > [optional: urgency] > [optional: impact] to create an incident with specified short description, urgency, and impact. For example, /now create incident Email is not working > 3 > 2.
Automate message actions
- In your Slack custom application, create a shortcut that appears on messages and enter the value, post_message_now for Callback ID. For more information, see Configure Slack app.
- In Workflow Studio, create a subflow configure to create the incident
records as per your requirement or create a copy of the default subflow, Respond to
Slack Message Action, and configure it.Note:Create an action and use the payload in the subflow input as per your requirement.
- Configure inbound decisions in ServiceNow instance.
- In the Condition, ensure that you specify the value of
callback_id as post_message_now and
specify the required parameters.
- In Answer, select the subflow you had configured.
- In the Condition, ensure that you specify the value of
callback_id as post_message_now and
specify the required parameters.
Post an approval message
- In Workflow Studio, create a copy of the default subflow,
Respond to Slack Approval Action, and configure it as per your requirement.Note:Create an action and use the payload in the subflow input as per your requirement.
- Configure outbound configurations in ServiceNow instance
- Open the default outbound configuration, Approval Message.
- In Action ID , specify the unique identifier for automating the task of posting an acknowledgement message. For example, value of Action ID can be approval_request.
- Configure inbound decisions in ServiceNow instance.
- In the Condition, ensure that you specify the value
of Action ID as
approval_request. You can specify other conditions
as per your requirement.
- In Answer, select the subflow you had configured.
- In the Condition, ensure that you specify the value
of Action ID as
approval_request. You can specify other conditions
as per your requirement.
When the Slack events match the relevant the action ID, the associated subflow, that is, the Respond to Slack Approval Action subflow is triggered. This subflow contains the logic to update the required record and send the relevant acknowledgement message on Slack channel.
Assign request based on acknowledgement
- In Workflow Studio, create a copy of the default subflow, On-Call Assign
by Acknowledgement, and configure it as per your requirement.Note:Create an action and use the payload in the subflow input as per your requirement.
- Configure outbound configurations in ServiceNow instance.
- Open the default outbound configuration, On Call: Assign by Acknowledgement.
- In Action ID , specify the unique identifier for automating the task of posting an acknowledgement message. For example, value of Action ID can be on_call_assign_by_acknowledgement.
- Configure inbound decisions in ServiceNow instance.
- In the Condition, ensure that you specify the value of Action ID as on_call_assign_by_acknowledgement. You can specify other conditions as per your requirement.
- In Answer, select the subflow you had configured.
Post an actionable message
- Configure outbound configurations in ServiceNow instance.
- Open the default outbound configuration, On Call: Assign by Acknowledgement.
- Select Target Table and Fields as per your requirement. For example, short_description and priority from the Task [task] table.
- Select Buttons as per your requirement. For example, Accept and Reject.
- In Action ID , specify the unique identifier for automating the task of posting an acknowledgement message. For example, value of Action ID can be on_call_assign_by_acknowledgement.
- In Workflow Studio, create a copy of the default subflow, Post Actionable
Message, and configure it as per your requirement.Note:Create an action and use the payload in the subflow input as per your requirement.
- In the Record Sys_ID input, provide the sys ID of the required record. For example, specify the sys ID of the task record.
- In the Template input, select template you had created in the outbound configurations.
- Configure inbound decisions in ServiceNow instance.
- In the Condition, ensure that you specify the value of Action ID as on_call_assign_by_acknowledgement. You can specify other conditions as per your requirement.
- In Answer, select the subflow you had configured.