Automate and customize Slack tasks
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
Perform these steps to automate events such as, create incident records, based on the 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
/nowand specify the required parameters.Note: You can specify up to 2 parameters in your condition to trigger the required subflow.
Slack command
2. In **Answer**, select the subflow you had configured.
When a Slack user enters the command, /now create incident <text>, the condition specified in inbound decision is met and the associated subflow is triggered. Similarly, you can customize subflows and inbound decisions to configure more Slack commands such as:
/now list incidentsto list all active incidents assigned to the logged in user./now helpto 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_nowfor 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_nowand specify the required parameters.
- In the Condition, ensure that you specify the value of callback_id as
Provide the required callback\_id.
2. In **Answer**, select the subflow you had configured.
Post an approval message
Perform these steps to automate posting an approval message on a Slack channel.
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 the Condition, ensure that you specify the value of Action ID as
Provide value for Action ID.
2. In **Answer**, select the subflow you had configured.
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
Perform these steps to automate assigning request:
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.
- In the Condition, ensure that you specify the value of Action ID as
Post an actionable message
Perform these steps to automate posting 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,
AcceptandReject. - 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.