doc/operations/incident_management/slack.md
{{< details >}}
{{< /details >}}
{{< history >}}
incident_declare_slash_command. Disabled by default.{{< /history >}}
[!flag] The availability of this feature is controlled by a feature flag. For more information, see the history. This feature is available for testing, but not ready for production use.
Many teams receive alerts and collaborate in real time during incidents in Slack. Use the GitLab for Slack app to:
Incident management for Slack is only available for GitLab.com. Some of the functionality described might be available for the GitLab Self-Managed Slack app.
To stay up to date, follow epic 1211.
Prerequisites:
Install the GitLab for Slack app. This way, you can use slash commands in Slack to create and update GitLab incidents.
Enable Slack notifications. Be sure to enable
notifications for Incident events, and to define a Slack channel to receive the relevant notifications.
Authorize GitLab to take actions on behalf of your Slack user. Each user must do this before they can use any of the incident slash commands.
To start the authorization flow, try executing a non-incident Slack slash command,
like /gitlab <project-alias> issue show <id>.
The <project-alias> you select must be a project that has the GitLab for Slack app set up. The select dialog has a hard limit of 100 projects.
For more information, see issue 377548.
After the GitLab for Slack app is configured, you can also use any of the existing Slack slash commands.
To declare a GitLab incident from Slack:
In Slack, in any channel or DM, enter the /gitlab incident declare slash command.
From the modal, select the relevant incident details, including:
If there is an existing incident template for your project, that template is automatically applied to the description text box. The template is applied only if the description text box is empty.
You can also include quick actions in the description text box.
For example, entering /link https://example.slack.com/archives/123456789 Dedicated Slack channel
adds a dedicated Slack channel to the incident you create. For a complete list of
quick actions for incidents, see Use GitLab quick actions.
Optional. Add a link to an existing Zoom meeting.
Select Create.
If the incident is successfully created, Slack shows a confirmation notification.
Use quick actions in the description text box when creating a GitLab incident from Slack. The following quick actions might be most relevant to you:
| Command | Description |
|---|---|
/assign @user1 @user2 | Adds an assignee to the GitLab incident. |
/label ~label1 ~label2 | Adds labels to the GitLab incident. |
/link <URL> <text> | Adds a link to a dedicated Slack channel, runbook, or any relevant resource to the Related resources section of an incident. |
/zoom <URL> | Adds a Zoom meeting link to the incident. |
If you have enabled notifications for incidents, you should receive notifications to the selected Slack channel every time an incident is opened, closed, or updated.