info:To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
info:To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
---
# Slack Notifications Service **(FREE)**
# Slack notifications service **(FREE)**
The Slack Notifications Service allows your GitLab project to send events
The Slack notifications service enables your GitLab project to send events
(such as issue creation) to your existing Slack team as notifications. Setting up
(such as issue creation) to your existing Slack team as notifications. Setting up
Slack notifications requires configuration changes for both Slack and GitLab.
Slack notifications requires configuration changes for both Slack and GitLab.
NOTE:
You can also use Slack slash commands to control GitLab inside Slack. This is the
You can also use Slack slash commands to control GitLab inside Slack. This is the
1. Sign in to your Slack team and [start a new Incoming WebHooks configuration](https://my.slack.com/services/new/incoming-webhook).
1. Sign in to your Slack team and [start a new Incoming WebHooks configuration](https://my.slack.com/services/new/incoming-webhook).
1.Select the Slack channel where notifications should be sent to by default.
1.Identify the Slack channel where notifications should be sent to by default.
Click the **Add Incoming WebHooks integration** button to add the configuration.
Select **Add Incoming WebHooks integration** to add the configuration.
1. Copy the **Webhook URL**, which we use later in the GitLab configuration.
1. Copy the **Webhook URL**, which is used later in the GitLab configuration.
## GitLab configuration
## GitLab configuration
1. Open your project's page, and navigate to your project's
1. On the top bar, select **Menu > Projects** and find your project.
[Integrations page](overview.md#accessing-integrations) at
1. On the left sidebar, select **Settings > Integrations**.
**Settings > Integrations**.
1. Select the **Slack notifications** integration to configure it.
1. Select the **Slack notifications** integration to configure it.
1. Click **Enable integration**.
1. In the **Enable integration** section, select the **Active** checkbox.
1. In **Trigger**, select the checkboxes for each type of GitLab event to send to Slack as a
1. In the **Trigger** section, select the checkboxes for each type of GitLab
notification. See [Triggers available for Slack notifications](#triggers-available-for-slack-notifications)
event to send to Slack as a notification. For a full list, see
for a full list. By default, messages are sent to the channel you configured during
[Triggers available for Slack notifications](#triggers-available-for-slack-notifications).
By default, messages are sent to the channel you configured during
[Slack integration](#slack-configuration).
[Slack integration](#slack-configuration).
1. (Optional) To send messages to a different channel, multiple channels, or as a direct message:
1. (Optional) To send messages to a different channel, multiple channels, or as
- To send messages to channels, enter the Slack channel names, separated by commas.
a direct message:
- To send direct messages, use the Member ID found in the user's Slack profile.
-*To send messages to channels,* enter the Slack channel names, separated by
commas.
-*To send direct messages,* use the Member ID found in the user's Slack profile.
NOTE:
NOTE:
Usernames and private channels are not supported.
Usernames and private channels are not supported.
1. In **Webhook**, provide the webhook URL that you copied from the
1. In **Webhook**, enter the webhook URL you copied from the previous
[Slack integration](#slack-configuration) step.
[Slack integration](#slack-configuration) step.
1. (Optional) In **Username**, provide the username of the Slack bot that sends the notifications.
1. (Optional) In **Username**, enter the username of the Slack bot that sends
1. Select the **Notify only broken pipelines** check box to only notify on failures.
the notifications.
1. In the **Branches to be notified** select box, choose which types of branches
1. Select the **Notify only broken pipelines** checkbox to notify only on failures.
1. In the **Branches to be notified** dropdown, select which types of branches
to send notifications for.
to send notifications for.
1. Leave the **Labels to be notified** field blank to get all notifications or add labels that the issue or merge request must have in order to trigger a notification.
1. Leave the **Labels to be notified** field blank to get all notifications or
1. Click **Test settings and save changes**.
add labels that the issue or merge request must have in order to trigger a
notification.
1. Select **Test settings** to verify your information, and then select
**Save changes**.
Your Slack team now starts receiving GitLab event notifications as configured.
Your Slack team now starts receiving GitLab event notifications as configured.
...
@@ -54,19 +59,19 @@ Your Slack team now starts receiving GitLab event notifications as configured.
...
@@ -54,19 +59,19 @@ Your Slack team now starts receiving GitLab event notifications as configured.
The following triggers are available for Slack notifications:
The following triggers are available for Slack notifications:
-**Push**: Triggered by a push to the repository.
| Trigger | Description |
-**Issue**: Triggered when an issue is created, updated, or closed.
|------------------------|-------------|
-**Confidential issue**: Triggered when a confidential issue is created,
| **Push** | Triggered by a push to the repository. |
updated, or closed.
| **Issue** | Triggered when an issue is created, updated, or closed. |
-**Merge request**: Triggered when a merge request is created, updated, or
| **Confidential issue** | Triggered when a confidential issue is created, updated, or closed. |
merged.
| **Merge request** | Triggered when a merge request is created, updated, or merged. |
-**Note**: Triggered when someone adds a comment.
| **Note** | Triggered when someone adds a comment. |
-**Confidential note**: Triggered when someone adds a confidential note.
| **Confidential note** | Triggered when someone adds a confidential note. |
-**Tag push**: Triggered when a new tag is pushed to the repository.
| **Tag push** | Triggered when a new tag is pushed to the repository. |
-**Pipeline**: Triggered when a pipeline status changes.
| **Pipeline** | Triggered when a pipeline status changes. |
-**Wiki page**: Triggered when a wiki page is created or updated.
| **Wiki page** | Triggered when a wiki page is created or updated. |
-**Deployment**: Triggered when a deployment starts or finishes.
| **Deployment** | Triggered when a deployment starts or finishes. |
-**Alert**: Triggered when a new, unique alert is recorded.
| **Alert** | Triggered when a new, unique alert is recorded. |
## Troubleshooting
## Troubleshooting
...
@@ -89,7 +94,7 @@ You may see an entry similar to the following in your Sidekiq log:
...
@@ -89,7 +94,7 @@ You may see an entry similar to the following in your Sidekiq log:
```
```
This is probably a problem either with GitLab communicating with Slack, or GitLab
This is probably a problem either with GitLab communicating with Slack, or GitLab
communicating with itself. The former is less likely since Slack's security certificates
communicating with itself. The former is less likely, as Slack's security certificates
should _hopefully_ always be trusted. We can establish which we're dealing with by using
should _hopefully_ always be trusted. We can establish which we're dealing with by using
the below rails console script.
the below rails console script.
...
@@ -114,6 +119,7 @@ If GitLab is not trusting HTTPS connections to itself, then you may
...
@@ -114,6 +119,7 @@ If GitLab is not trusting HTTPS connections to itself, then you may
need to [add your certificate to the GitLab trusted certificates](https://docs.gitlab.com/omnibus/settings/ssl.html#install-custom-public-certificates).
need to [add your certificate to the GitLab trusted certificates](https://docs.gitlab.com/omnibus/settings/ssl.html#install-custom-public-certificates).
If GitLab is not trusting connections to Slack, then the GitLab
If GitLab is not trusting connections to Slack, then the GitLab
OpenSSL trust store is incorrect. Some typical causes: overriding
OpenSSL trust store is incorrect. Some typical causes:
the trust store with `gitlab_rails['env'] = {"SSL_CERT_FILE" => "/path/to/file.pem"}`,
or by accidentally modifying the default CA bundle `/opt/gitlab/embedded/ssl/certs/cacert.pem`.
- Overriding the trust store with `gitlab_rails['env'] = {"SSL_CERT_FILE" => "/path/to/file.pem"}`.
- Accidentally modifying the default CA bundle `/opt/gitlab/embedded/ssl/certs/cacert.pem`.