Slack notifications (deprecated)
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
This feature was deprecated in GitLab 15.9. Use the GitLab for Slack app instead.
The Slack notifications integration enables your GitLab project to send events (such as issue creation) to your existing Slack team as notifications. Setting up Slack notifications requires configuration changes for both Slack and GitLab.
Comparison with the GitLab for Slack app
Both integrations send the same events with the same notification settings. For each event, you enter up to 10 Slack channel names, separated by commas. In both integrations, you can limit notifications to:
- Broken pipelines only
- Pipeline status changes only
- Selected branches
- Events with selected labels
You can configure both integrations for the project, group, or instance.
You install the GitLab for Slack app from the integration settings of your project, group, or instance. On GitLab Self-Managed and GitLab Dedicated, the app appears there only after an administrator configures it for the instance. For more information, see GitLab for Slack app administration.
They differ in the following ways:
| Feature | Slack notifications | GitLab for Slack app |
|---|---|---|
| Status | Deprecated in GitLab 15.9. | Current and recommended. |
| Setup | Paste a Slack incoming webhook URL into GitLab. | Install a native Slack app from GitLab. |
| Capabilities | Notifications only. | Notifications, slash commands, and the GitLab Duo integration. |
| Credentials | A webhook URL stored in GitLab. Anyone with the URL can post to the channel. | An OAuth bot token stored in GitLab. |
| Availability | No administrator setup required. | On GitLab Self-Managed and GitLab Dedicated, an administrator must configure the app before it appears. |
Migrate to the GitLab for Slack app
Migrate to the GitLab for Slack app to keep receiving Slack notifications and to use slash commands and the GitLab Duo integration.
Settings do not transfer automatically, so you must repeat your configuration in the new integration. You can run both integrations at the same time during the migration. Until you turn off Slack notifications, each event is delivered twice.
Prerequisites:
- The GitLab for Slack app must be available on your instance. On GitLab Self-Managed and GitLab Dedicated, an administrator must configure the app first.
- You must have at least the Maintainer role for the project, the Owner role for the group, or administrator access for the instance where Slack notifications is configured.
- You must have permission to add apps to your Slack workspace.
These steps describe migrating a project-level integration. If Slack notifications is configured at the group or instance level, follow the same steps at that level instead:
- For a group, in the top bar, select Search or go to and find your group.
- For the instance, in the upper-right corner, select Admin.
Then, in the left sidebar, select Settings > Integrations.
To migrate to the GitLab for Slack app:
- Note your current configuration. In the top bar, select Search or go to and find your project. In the left sidebar, select Settings > Integrations, then select Slack notifications. Record the events you have selected, the channel names for each event, and your notification settings.
- Install the GitLab for Slack app.
- In the GitLab for Slack app, re-enter the event selections, channel names, and notification settings you recorded. For more information, see configure notifications.
- If a target channel is private, add the app to the channel.
- Select Test settings and confirm the notification arrives in Slack.
- Turn off the Slack notifications integration. Return to the Slack notifications settings from the first step. Under Enable integration, clear the Active checkbox, then select Save changes. Your configuration is retained, so you can turn it back on if you need to.
- Confirm that notifications continue to arrive from the GitLab for Slack app.
- In Slack, remove the incoming webhook integration you created in Configure Slack so it stops being a live credential. This step cannot be undone. After you remove the webhook, you can no longer roll back by turning Slack notifications back on, because the stored webhook URL stops working.
After you turn off Slack notifications, the integration remains in the project’s list of integrations.
Configure Slack
- Sign in to your Slack team and start a new Incoming WebHooks configuration.
- Identify the Slack channel where notifications should be sent to by default. Select Add Incoming WebHooks integration to add the configuration.
- Copy the Webhook URL to use later when you configure GitLab.
Configure GitLab
If Slack notifications is not in your project’s list of integrations, see effect on the Slack notifications integration.
To configure Slack notifications:
- In the top bar, select Search or go to and find your project.
- In the left sidebar, select Settings > Integrations.
- Select Slack notifications.
- Under Enable integration, select the Active checkbox.
- In the Trigger section, select the checkboxes for each type of GitLab event to send to Slack as a notification. For a full list, see triggers for Slack notifications. By default, messages are sent to the channel you configured during Slack configuration.
- Optional. To send messages to a different channel, multiple channels, or as
a direct message:
- 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.
- In Webhook, enter the webhook URL you copied in the Slack configuration step.
- Optional. In Username, enter the username of the Slack bot that sends the notifications.
- Select the Notify only broken pipelines checkbox to notify only on failures.
- Select the Notify only when status changes checkbox to send notifications only when the pipeline status for the ref changes.
- In the Branches for which notifications are to be sent dropdown list, select which types of branches to send notifications for.
- Leave the Labels to be notified field blank to get all notifications, or add labels that the issue or merge request must have to trigger a notification.
- Optional. Select Test settings.
- Select Save changes.
Your Slack team now starts receiving GitLab event notifications as configured.
Triggers for Slack notifications
The following triggers are available for Slack notifications:
| Trigger name | Trigger event |
|---|---|
| Push | A push to the repository. |
| Issue | A work item is created, closed, or reopened. |
| Incident | An incident is created, closed, or reopened. |
| Confidential issue | A confidential work item is created, closed, or reopened. |
| Merge request | A merge request is created, merged, approved, closed, or reopened. |
| Note | A comment is added. |
| Confidential note | An internal note or comment on a confidential work item is added. |
| Tag push | A new tag is pushed to the repository or removed. |
| Pipeline | A pipeline status changed. |
| Wiki page | A wiki page is created or updated. |
| Deployment | A deployment starts or finishes. |
| Alert | A new, unique alert is recorded. |
| Group mention in public | A group is mentioned in a public context. |
| Group mention in private | A group is mentioned in a confidential context. |
| Vulnerability | A new, unique vulnerability is recorded. |
Trigger notifications for group mentions
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
Notifications are triggered only if all direct group members have permission to view the resource (for example, merge request) where the mention is made. A notification will only be sent to at most 3 groups per event.
Troubleshooting
If your Slack integration is not working, start troubleshooting by searching through the Sidekiq logs for errors relating to your Slack service.
Error: Something went wrong on our end
You might get this generic error message in the GitLab UI. Review the logs to find the error message and keep troubleshooting from there.
Error: certificate verify failed
You might see an entry like the following in your Sidekiq log:
2019-01-10_13:22:08.42572 2019-01-10T13:22:08.425Z 6877 TID-abcdefg Integrations::ExecuteWorker JID-3bade5fb3dd47a85db6d78c5 ERROR: {:class=>"Integrations::ExecuteWorker :integration_class=>"SlackService", :message=>"SSL_connect returned=1 errno=0 state=error: certificate verify failed"}This issue occurs when there is a problem with GitLab communicating with Slack, or GitLab communicating with itself. The former is less likely, as Slack security certificates should always be trusted.
To view which of these problems is the cause of the issue:
Start a Rails console:
sudo gitlab-rails console -e production # for source installs: bundle exec rails console -e productionRun the following commands:
# replace <SLACK URL> with your actual Slack URL result = Net::HTTP.get(URI('https://<SLACK URL>'));0 # replace <GITLAB URL> with your actual GitLab URL result = Net::HTTP.get(URI('https://<GITLAB URL>'));0
If GitLab does not trust HTTPS connections to itself, add your certificate to the GitLab trusted certificates.
If GitLab does not trust connections to Slack, the GitLab OpenSSL trust store is incorrect. Typical causes are:
- 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.
Bulk update to disable the Slack Notification integration
To disable notifications for all projects that have Slack integration enabled, start a rails console session and use a script similar to the following:
Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.
# Grab all projects that have the Slack notifications enabled
p = Project.find_by_sql("SELECT p.id FROM projects p LEFT JOIN integrations s ON p.id = s.project_id WHERE s.type_new = 'Integrations::Slack' AND s.active = true")
# Disable the integration on each of the projects that were found.
p.each do |project|
project.slack_integration.update!(:active, false)
end