Slack
Workflows

Send Slack Blocks

16min

Description

Sometimes, sending a simple message just isn't enough. This action allows you to leverage Slack's Block Kit to send complex messages to channels, users, and user groups.

Action Attributes

Document image


Name

This field is automatically set for you. You can rename this field to whatever best describes your action. The value in this field does not affect how the workflow action behaves.

Slack Users

Specify the Slack user(s) you wish to send the custom Slack block to.

Slack User Groups

Specify which Slack user group(s) you wish to send the custom Slack block to. All users part of the specified user group(s) will be sent the block. You can read more about Slack user groups here.

Channels

This field specifies which Slack channels to send the Slack block to.

Some common selections:

  • Setting to {{ incident.slack_channel_id }} will send the block to the Slack channel of the triggering incident.
  • The Liquid snytax {{ parent_incident.slack_channel_id }} can be used for sub incidents and it will send the block to the Slack channel of the parent incident.
  • You can also send blocks to static channel (e.g. #gernal, #alerts)

Send as Ephemeral

If selected, your message will be sent as a hidden message visible only to the specified users.

A value must be set for the Slack Users or Slack User Groups and Channels when this field is selected. Additionally, the selected users need to be in the specified channels.

Pin to Channel

If selected, your message will pinned to the specified channel(s).

Message Threading Options

If you want to thread the block under an existing block/message that Rootly has previously sent, you can do so by selecting a parent block/message to be threaded under.

Filter Tasks by Workflow

This field is used to filter for the workflow that contains the specific action responsible for sending the parent message. The value in this field will not persist once the workflow is saved, as the Select a Task field is what ultimately determines the parent message to thread under.

Select a Task

This field is used to select the specific action that's responsible for sending the parent block/message. This field determines which block/message is the parent block/message to thread under.

Update Parent Message

If this field is selected, the workflow will update the original parent block/message, instead of threading underneath it.

Broadcast Thread Reply to Channel

If this field is selected, the threaded block will also be broadcased as a new block in the specified channels.

Notification Preview

Content in this field will be displayed in the push notifications. This field supports Liquid variables.

Blocks

The blocks field consist of the payload that will be send in Slack. Customizing this payload will allow you to build custom messaging. The payload follows the same restrictions as Slack's block elements do. You can preview and check if your payload is valid by clicking the Preview button. This button will route you to Slack's Block Kit builder.

The Block Kit builter is a Slack-built application. So, it will not be able to recognize any Liquid variables that you might have referenced in your payload. You will need to use Rootly's Incident Variable Explorer in conjunction with Slack's Block Kit builder.

Select a Template Dropdown

You can choose any pre-built blocks from the Select a template dropdown field. This is a great starting point to get familiarized with Slack's Block Kit syntax.

Section

Selecting a section will append a pre-built section to your existing payload.

Sample text block with markdown enabled

{ "type": "section", "text": { "type": "mrkdwn", "text": "Allows for *markdown formatting*: <https://api.slack.com/reference/surfaces/formatting#basics| Slack Markdown Formatting Guide>" } }

Sample image block

{ "type": "section", "text": { "type": "mrkdwn", "text": "Some *text* here with markdown support" }, "accessory": { "type": "image", "image_url": "https://picsum.photos/200", "alt_text": "placeholder_image" } }

Actions

Selecting an action will append a pre-built action element to your existing payload. Each block option here is customizable. The action_id field must be set to one of the following available values.

Available Rootly Actions IDs

action_id Value

Description

toolbar_update_incident_summary

Brings up a modal for editing the incident summary

toolbar_update_status

Brings up a modal for updating the incident status

archive_incident

Archives the incident

manage_incident_role_assignments_dialog

Brings up modal for updating the incident roles

toolbar_update_incident

Brings up a modal for editing the incident's attributes

toolbar_available_commands

Brings up the help modal

add_feedback

Brings up modal for adding incident feedback

manage_form_field_selections

Brings up a modal for editing custom fields

manage_incident_action_items

Brings up a modal for editing the incident's action items

todo_dialog

Brings up a modal showing action items assigned to whichever user clicked the button

pagerduty_responders

Brings up a modal allowing users to add Pagerduty responders (If the Pagerduty integration is installed)

opsgenie_responders

Brings up a modal allowing users to add Opsgenie responders (If the Opsgenie integration is installed)

victor_ops_responders

Brings up a modal allowing useres to add Victorops responders (If the Victorops intetgration is installed)

snooze_reminder

Snoozes the workflow that sent this message if the workflow is a repeating workflow

pause_reminder

Pauses the workflow that sent this message if the workflow is a repeating workflow

restart_reminder

Restarts the workflow that sent this message if the workflow is a repeating workflow and is in a paused state

update_status_page_dialog

Brings up modal for publishing a status page event

trigger_custom_workflow

Runs a custom workflow. Must have an accompanying value set to indicate what workflow to run. See the sample below.

The value is the workflows 'slack command' found in web UI under the 'advanced settings' tab for each workflow.

open_custom_form

Opens a custom form.

Must have an accompanying value set to indicate what form to open. This value is the slug that can be found at the top of the custom forms web UI.

Sample Trigger Custom Workflow Action

{ "type": "actions", "elements": [ { "type": "button", "style": "primary", "text": { "type": "plain_text", "emoji": true, "text": "Show Incomplete Action Items" }, "value": "incident-list-out-incomplete-action-items", "action_id": "trigger_custom_workflow" } ] }



Attachments

Attach secondary content to your main message. Use this for content that adds further context or additional information but isn't vital. Please note attachments are a legacy part of the Slack messaging functionality. You should understand that they might change in the future, in ways that reduce their visibility or utility. See Slack documentation for more details.