mattermost.md 2.49 KB
Newer Older
1 2
# Mattermost Notifications Service

3 4 5 6
The Mattermost Notifications Service allows your GitLab project to send events (e.g., `issue created`) to your existing Mattermost team as notifications. This requires configurations in both Mattermost and GitLab.

You can also use Mattermost slash commands to control GitLab inside Mattermost. This is the separately configured [Mattermost slash commands](mattermost_slash_commands.md).

7 8 9 10
## On Mattermost

To enable Mattermost integration you must create an incoming webhook integration:

Evan Read's avatar
Evan Read committed
11 12 13
1. Sign in to your Mattermost instance.
1. Visit incoming webhooks, that will be something like: `https://mattermost.example.com/your_team_name/integrations/incoming_webhooks/add`.
1. Choose a display name, description and channel, those can be overridden on GitLab.
14 15
1. Save it, copy the **Webhook URL**, we'll need this later for GitLab.

16 17 18 19 20 21 22
Incoming Webhooks might be blocked on your Mattermost instance. Ask your Mattermost admin
to enable it on:

- **Mattermost System Console > Integrations > Integration Management** in Mattermost
  versions 5.12 and later.
- **Mattermost System Console > Integrations > Custom Integrations** in Mattermost
  versions 5.11 and earlier.
23 24 25 26 27 28 29

Display name override is not enabled by default, you need to ask your admin to enable it on that same section.

## On GitLab

After you set up Mattermost, it's time to set up GitLab.

30 31 32
Navigate to the [Integrations page](project_services.md#accessing-the-project-services)
and select the **Mattermost notifications** service to configure it.
There, you will see a checkbox with the following events that can be triggered:
33 34 35

- Push
- Issue
36
- Confidential issue
37 38
- Merge request
- Note
39
- Confidential note
40
- Tag push
41
- Pipeline
42
- Wiki page
43
- Deployment
44

45 46
Below each of these event checkboxes, you have an input field to enter
which Mattermost channel you want to send that event message. Enter your preferred channel handle (the hash sign `#` is optional).
47 48 49 50 51

At the end, fill in your Mattermost details:

| Field | Description |
| ----- | ----------- |
52
| **Webhook**  | The incoming webhook URL which you have to set up on Mattermost, it will be something like: `http://mattermost.example/hooks/5xo…` |
53
| **Username** | Optional username which can be on messages sent to Mattermost. Fill this in if you want to change the username of the bot. |
54
| **Notify only broken pipelines** | If you choose to enable the **Pipeline** event and you want to be only notified about failed pipelines. |
55 56

![Mattermost configuration](img/mattermost_configuration.png)