GitLab for Slack app

Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated
History
note
This page contains user documentation for the GitLab for Slack app. For administrator documentation, see GitLab for Slack app administration.

The GitLab for Slack app is a native Slack app that provides slash commands and notifications in your Slack workspace. GitLab links your Slack user with your GitLab user so that any command you run in Slack is run by your linked GitLab user.

Install the GitLab for Slack app

Prerequisites:

In GitLab 15.0 and later, the GitLab for Slack app uses granular permissions. Although functionality has not changed, you should reinstall the app.

From the project or group settings

History
On self-managed GitLab, by default this feature is available. To hide the feature, an administrator can disable the feature flag named gitlab_for_slack_app_instance_and_group_level. On GitLab.com and GitLab Dedicated, this feature is available.

To install the GitLab for Slack app from the project or group settings:

  1. On the left sidebar, select Search or go to and find your project or group.
  2. Select Settings > Integrations.
  3. Select GitLab for Slack app.
  4. Select Install GitLab for Slack app.
  5. On the Slack confirmation page, select Allow.

From the Slack App Directory

Tier: Free, Premium, Ultimate Offering: GitLab.com

On GitLab.com, you can also install the GitLab for Slack app from the Slack App Directory.

To install the GitLab for Slack app from the Slack App Directory:

  1. Go to the GitLab for Slack page.
  2. Select a GitLab project to link with your Slack workspace.

Reinstall the GitLab for Slack app

When GitLab releases new features for the GitLab for Slack app, you might have to reinstall the app to use these features.

To reinstall the GitLab for Slack app:

  1. On the left sidebar, select Search or go to and find your project.
  2. Select Settings > Integrations.
  3. Select GitLab for Slack app.
  4. Select Reinstall GitLab for Slack app.
  5. On the Slack confirmation page, select Allow.

The GitLab for Slack app is updated for all projects that use the integration.

Alternatively, you can configure the integration again.

Slash commands

You can use slash commands to run common GitLab operations.

For the GitLab for Slack app:

  • You must authorize your Slack user when you run your first slash command.
  • You can replace <project> with a project full path or create a project alias for slash commands.

If you use Slack slash commands or Mattermost slash commands instead:

  • Replace /gitlab with the trigger name you’ve configured for these integrations.
  • Remove <project>.

The following slash commands are available for GitLab:

Command Description
/gitlab help Shows all available slash commands.
/gitlab <project> issue show <id> Shows the issue with the ID <id>.
/gitlab <project> issue new <title> Shift+Enter <description> Creates an issue with the title <title> and description <description>.
/gitlab <project> issue search <query> Shows up to five issues that match <query>.
/gitlab <project> issue move <id> to <project> Moves the issue with the ID <id> to <project>.
/gitlab <project> issue close <id> Closes the issue with the ID <id>.
/gitlab <project> issue comment <id> Shift+Enter <comment> Adds a comment with the comment body <comment> to the issue with the ID <id>.
/gitlab <project> deploy <from> to <to> Deploys from the <from> environment to the <to> environment.
/gitlab <project> run <job name> <arguments> Executes the ChatOps job <job name> on the default branch.
/gitlab incident declare Opens a dialog to create an incident from Slack.

deploy command

To deploy to an environment, GitLab tries to find a manual deployment action in the pipeline.

If only one deployment action is defined for an environment, that action is triggered. If more than one deployment action is defined, GitLab tries to find an action name that matches the environment name.

The command returns an error if GitLab cannot find a matching deployment action.

Create a project alias

In the GitLab for Slack app, slash commands use a project full path by default. You can use a project alias instead.

To create a project alias for slash commands in the GitLab for Slack app:

  1. On the left sidebar, select Search or go to and find your project.
  2. Select Settings > Integrations.
  3. Select GitLab for Slack app.
  4. Next to the project path or alias, select Edit.
  5. Enter the new alias and select Save changes.

Slack notifications

History

You can receive notifications to Slack channels for certain GitLab events.

Configure notifications

To configure Slack notifications:

  1. On the left sidebar, select Search or go to and find your project.
  2. Select Settings > Integrations.
  3. Select GitLab for Slack app.
  4. In the Trigger section:
    • Select the checkbox for each GitLab event you want to receive notifications for in Slack.
    • For each checkbox you select, enter the names of the Slack channels you want to receive notifications. You can enter up to 10 channel names separated by commas (for example, #channel-one, #channel-two).

      note
      If the Slack channel is private, you must add the GitLab for Slack app to the channel.
  5. Optional. In the Notification settings section:
    • Select the Notify only broken pipelines checkbox to receive notifications for failed pipelines only.
    • From the Branches for which notifications are to be sent dropdown list, select the branches you want to receive notifications for.
    • For Labels to be notified, enter any or all of the labels a GitLab issue, merge request, or comment must have to receive notifications for. Leave blank to receive notifications for all events.
  6. Optional. Select Test settings.
  7. Select Save changes.

Receive notifications to a private channel

To receive notifications to a private Slack channel, you must add the GitLab for Slack app to the channel:

  1. Mention the app in the channel by entering @GitLab.
  2. Select Add to Channel.

Notification events

The following GitLab events can trigger notifications in Slack:

Event Description
Push A push is made to the repository.
Issue An issue is created, closed, or reopened.
Confidential issue A confidential issue is created, closed, or reopened.
Merge request A merge request is created, merged, closed, or reopened.
Note A comment is added.
Confidential note An internal note or comment on a confidential issue is added.
Tag push A tag is pushed to the repository or removed.
Pipeline A pipeline status changes.
Wiki page A wiki page is created or updated.
Deployment A deployment is started or finished.
Group mention in public A group is mentioned in a public channel.
Group mention in private A group is mentioned in a private channel.
Incident An incident is created, closed, or reopened.
Vulnerability A new, unique vulnerability is recorded.
Alert A new, unique alert is recorded.

Trigger notifications for group mentions

History
On self-managed GitLab, by default this feature is available. To hide the feature, an administrator can disable the feature flag named gitlab_for_slack_app_instance_and_group_level. On GitLab.com and GitLab Dedicated, this feature is available.

To trigger a notification event for a group mention, use @<group_name> in:

  • Issue and merge request descriptions
  • Comments on issues, merge requests, and commits