Skip to main content
In this guide, we’ll demonstrate how to integrate GitLab ChatOps into your Slack workspace. With GitLab ChatOps, you can trigger CI/CD pipelines, manage issues, and review job outputs—all without leaving Slack.
The image shows a GitLab documentation page about ChatOps, detailing its integration with CI/CD jobs through chat services like Slack, and includes information on slash command integrations and workflow configuration.

Requirements

  • A GitLab project with the GitLab for Slack app installed and configured
  • Enabled slash commands in Slack (Mattermost uses different commands)

Available Slash Commands

Use the /gitlab help command to list all supported GitLab ChatOps slash commands in your workspace.
The image shows a webpage from GitLab documentation about the GitLab for Slack app, detailing installation instructions and features like slash commands and notifications.
The image shows a GitLab documentation page detailing slash commands for the GitLab Slack app, with a list of commands and their descriptions.

List Commands in Slack

In your GitLab notification channel (e.g., #gitlab-notifications), type:
The image shows a Slack workspace with a channel named "gitlab-notifications" where users and bots are interacting, including notifications about GitLab activities.

Creating an Issue via ChatOps

You can quickly create issues directly in Slack:
  1. Identify your project alias (group/project) set up during Slack integration.
  2. Run the new-issue command:
The image shows the GitLab integration settings for a Slack app, indicating that the integration is active and configured to trigger notifications when a push is made to the repository.
The image shows a Slack interface with a channel named "gitlab-notifications" open, displaying messages related to GitLab commands and notifications.
Slack will confirm the issue creation. You can verify it in GitLab:
The image shows a GitLab interface with an open issue titled "Demo Title" in a project named "Solar System." It includes options for creating a merge request, adding labels, and managing child and linked items.

Running CI Jobs via ChatOps

Assuming your .gitlab-ci.yml defines a unit_testing job:
Trigger this job in Slack:
If you need to run the job on a feature branch:
If escaping special characters in branch names fails, you may temporarily change your project’s default branch in GitLab.
  1. Go to Settings > Repository > Default branch
  2. Select your feature branch and save
The image shows a GitLab repository settings page, specifically focusing on branch defaults and branch name templates. A cursor is hovering over the "Save changes" button.
The image shows a GitLab repository interface with a list of files and their last commit messages. The sidebar includes options like branches, commits, and merge requests.
Once the default branch is updated, rerun without --branch:
Back in GitLab you’ll see the new pipeline logs:
You’ll also receive job-completion notifications directly in Slack, keeping you informed without context switching.

References

Watch Video