doc/user/project/integrations/slack.md
{{< details >}}
{{< /details >}}
[!warning] This feature was deprecated in GitLab 15.9 and is planned for removal in 19.0. Use the GitLab for Slack app instead. This change is a breaking change.
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.
You can also use Slack slash commands to control GitLab from Slack. Slash commands are configured separately.
{{< history >}}
{{< /history >}}
Your Slack team now starts receiving GitLab event notifications as configured.
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. |
{{< history >}}
group_mention_access_check. Disabled by default.{{< /history >}}
To trigger a notification event for a group mention, use @<group_name> in:
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.
If your Slack integration is not working, start troubleshooting by searching through the Sidekiq logs for errors relating to your Slack service.
Something went wrong on our endYou might get this generic error message in the GitLab UI. Review the logs to find the error message and keep troubleshooting from there.
certificate verify failedYou 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 production
Run 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:
gitlab_rails['env'] = {"SSL_CERT_FILE" => "/path/to/file.pem"}./opt/gitlab/embedded/ssl/certs/cacert.pem.To disable notifications for all projects that have Slack integration enabled, start a rails console session and use a script similar to the following:
[!warning] 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