Skip to main content

Connect GitLab to Mattermost

Minimize distractions and reduce context switching between your GitLab code repositories and your communication platform by integrating GitLab with Mattermost. You control which events trigger notifications beyond default events, including merges, issue comments, merge request comments, pipelines, pull reviews, and many more. Help your teams stay focused and productive with daily task summaries, real-time updates and notifications on new and closed merge requests, new and closed issues, and tag creation events, directly from Mattermost channel subscriptions.

Mattermost supports both Software-as-a-Service (SaaS) and on-premises versions of GitLab.

An example of the GitLab integration for Mattermost.

Deploy

A Mattermost system admin must perform the following steps to deploy the GitLab integration.

Install the integration

  1. In Mattermost, from the Product menu Navigate between Channels, collaborative playbooks, and boards using the product menu icon., select App Marketplace.
  2. Search for or scroll to GitLab, and select Install.

Set up the integration

You can configure the GitLab integration using either the built-in setup wizard (recommended) or by following the manual configuration steps.

The recommended way to configure the GitLab integration is using the built-in setup wizard. The wizard guides you through each step of the configuration process, including creating the OAuth app in GitLab.

  1. In any Mattermost channel, run the /gitlab setup slash command.
  2. Follow the interactive prompts to complete the setup.

The wizard walks you through:

  • Creating and configuring an OAuth app in GitLab
  • Configuring the plugin settings in Mattermost
  • Announcing the integration to your team

You can also run individual setup steps at any time using the following subcommands:

  • /gitlab setup oauth: Configure the OAuth2 application in GitLab.
  • /gitlab setup announce: Announce the integration availability to designated channels.

Upgrade

We recommend updating this integration as new versions are released. Generally, updates are seamless and don't interrupt the user experience in Mattermost. Visit the Releases page for the latest release, available releases, and compatibility considerations.

Enable

Once you setup the integration, notify your teams that they can connect their GitLab accounts to Mattermost.

Use

Users who want to use GitLab interconnectivity must connect their GitLab account to Mattermost.

Once connected, you'll receive direct messages from the GitLab bot in Mattermost when someone mentions you, requests a review, comments on, or modifies one of your merge requests/issues, or assigns you to an issue on GitLab.

Connect a GitLab account to Mattermost

Run the /gitlab connect slash command in any Mattermost channel to link your Mattermost account with your GitLab account.

Disconnect a GitLab account by running the /gitlab disconnect slash command. Run the /gitlab me slash command to review which account is connected to GitLab.

Once connected, run the /gitlab help slash command to see what you can do.

Get started

Run the /gitlab todo slash command to get a list of to-do's, assigned issues, assigned merge requests and merge requests awaiting your review. Alternatively, use the options located in the left sidebar.

Run the /gitlab webhook slash command to have GitLab send events to Mattermost. For example: /gitlab webhook add group[/project]

Channel subscriptions

Run the /gitlab subscriptions list to review all of your subscriptions.

Run the /gitlab subscriptions add group[/project] [features] slash command to subscribe a Mattermost channel and receive posts for new merge requests, issues, or other features, from a GitLab project. To unsubscribe and stop receiving posts, run the /gitlab subscriptions delete group[/project] slash command.

The following features are supported for channel subscriptions:

  • merges - Get notified when merge requests are merged
  • issues - Get notified when issues are created
  • pushes - Get notified when commits are pushed to a branch
  • issue_comments - Get notified when comments are made on issues
  • merge_request_comments - Get notified when comments are made on merge requests
  • tag - Get notified when tags are created
  • pipeline - Get notified about pipeline events (includes child pipeline events if enabled in plugin configuration)
  • wiki - Get notified about wiki page events
  • releases - Get notified when releases are created
  • deployments - Get notified about deployment events

For example, to subscribe to release and deployment events: /gitlab subscriptions add group[/project] releases,deployments

For each project you want to receive notifications for or subscribe to, create a webhook in a channel where you want to watch events sent from GitLab by running the /gitlab webhook slash command. For example: /gitlab webhook add group[/project]

Create issues and manage comments

You can create GitLab issues and manage issue comments directly from Mattermost using slash commands and interactive modals.

Create a GitLab issue

Run the /gitlab issue create slash command to open an interactive modal where you can create a new GitLab issue. The modal allows you to perform the following actions:

  • Set the issue title and description
  • Assign labels
  • Set the assignee
  • Choose the milestone
  • Select the target project

Attach comments to existing issues

Run the /gitlab issue comment [issue-number] slash command to attach a comment to an existing GitLab issue. This opens an interactive modal where you can compose and submit your comment directly from Mattermost.

Update settings

Run the /gitlab settings [setting] [value] slash command to update your preferences for the integration:

  • Turn personal notifications on or off.
  • Turn reminders on or off when you connect initially each day.

Get help

Mattermost customers can open a Mattermost support case. To report a bug, please open a GitHub issue against the Mattermost GitLab plugin repository.

For questions, feedback, and assistance, join our public Integrations and Apps channel on the Mattermost Community Server for assistance.

Mattermost Team Edition and Free customers can visit the Mattermost peer-to-peer troubleshooting forum to access the global Mattermost Community for assistance.