Configuring Slack

Configuration for Slack plugin.

By default, Dispatch ships with support for Slack. Below, is how to configure the slack plugin to work with Dispatch.

The Slack plugin relies on the Events API to receive events for the event types the app is subscribed to. Dispatch receives these events at the /api/v1/events/slack/event API endpoint. Slack will also send Web requests to the /api/v1/events/slack/command and /api/v1/events/slack/action API endpoints for slash (/) commands and interactive components like dialogs. These endpoints must be publicly available in order for the Dispatch Slack app to work correctly.

Configuration

SLACK_APP_USER_SLUG

Specifies the Slack app id, so Dispatch can filter events generated by the app (e.g. message posted in the channel). Slack specifically calls this an "App ID."

SLACK_WORKSPACE_NAME

Specifies the name of the workspace the Slack app is installed in. This is typically the subdomain provided by Slack. For example, if your Slack workspace is accessible at "example.slack.com," you would set your workspace name to "example".

SLACK_API_BOT_TOKEN [secret: True]

The app's bot token necessary to communicate with the Slack API. Slack refers to this as your "Bot User OAuth Access Token," and should be revealed to app collaborators when you install the app.

SLACK_SIGNING_SECRET [secret: True]

Secret used to verify signatures included on each HTTP request that Slack sends. Slack refers to this as your "Signing Secret."

SLACK_USER_ID_OVERRIDE [default: None]

Used during development to funnel all messages to a particular user.

SLACK_COMMAND_MARK_ACTIVE_SLUG [default: '/dispatch-mark-active'] [DEPRECATED]

Active command as displayed in Slack.

SLACK_COMMAND_MARK_STABLE_SLUG [default: '/dispatch-mark-stable'] [DEPRECATED]

Stable command as displayed in Slack.

SLACK_COMMAND_MARK_CLOSED_SLUG [default: '/dispatch-mark-closed'] [DEPRECATED]

Close command as displayed in Slack.

SLACK_COMMAND_STATUS_REPORT_SLUG [default: '/dispatch-status-report']

Status report command as displayed in Slack.

SLACK_COMMAND_LIST_TASKS_SLUG [default: '/dispatch-list-tasks']

List tasks command as displayed in Slack.

SLACK_COMMAND_LIST_PARTICIPANTS_SLUG [default: '/dispatch-list-participants']

List participants command as displayed in Slack.

SLACK_COMMAND_ASSIGN_ROLE [default: '/dispatch-assign-role']

Assign role command as displayed in Slack.

SLACK_COMMAND_UPDATE_INCIDENT [default: '/dispatch-update-incident']

Update incident command as displayed in Slack.

SLACK_COMMAND_ENGAGE_ONCALL [default: '/dispatch-engage-oncall']

Engage oncall command as displayed in Slack.

SLACK_COMMAND_LIST_RESOURCES [default: \'/dispatch-list-resources']

List resources command as displayed in Slack.

SLACK_PROFILE_DEPARTMENT_FIELD_ID

Specifies the profile field ID where Department is mapped

SLACK_PROFILE_TEAM_FIELD_ID

Specifies the profile field ID where Team is mapped

Specifies the profile field ID where the weblink is mapped

Event Subscriptions

To enable Dispatch to process Slack events, ensure your bot is subscribed to the following events:

Commands

To enable Dispatch's slash commands you must add them to the Slack app first. Ensure that the Command matches the configuration variables above (e.g. /dispatch-update-incident) and that the Request URL points to the events command API endpoint of the Dispatch server at /api/v1/events/slack/command.

Interactivity

To enable Dispatch to generate interactive components such as dialogs, ensure that the Request URL is pointing to the event action API endpoing of the Dispatch server at /api/v1/events/slack/action.

Reactions

Dispatch creates events off of Slack messages reacted with the stopwatch reaction, which then are displayed in the incident timeline. The event will contain the contents and author of the message.

OAuth & Permissions

The Bot User OAuth Access Token is used to issue queries against the Slack API.

Scopes

The following are the scopes required for the Dispatch Slack App to function correctly.

Bot Token Scopes

channels:read
chat:write
commands
files:read
groups:history
groups:read
groups:write
im:history
im:read
im:write
mpim:history
mpim:read
mpim:write
pins:write
reactions:read
reactions:write
reminders:write
remote_files:read
team:read
users:read
users:read.email
users.profile:read
users:write

User Token Scopes

channels:read
groups:history
groups:read