Slack notifications from Bitbucket Server or Data Center user guide for repository-level configuration.

Functionality

Functionality is to notify users about pull requests and push activities. There are global, project and repository-specific configurations. Project-specific configuration can override global settings.

This Bitbucket Server and Data Center application to handle both cases:

  • Send slack messages about pull request activities and push operations

  • Configure the size of the message from Minimal, Compact and Verbose.

  • Filter by source and destination branches

  • Configure settings on the global, project and repository levels.

  • Override global settings on the project and repository levels.

  • Use Slack threads to group pull request-related messages. More details are here.

  • Receive updates about version updates from Atlassian products like Jira, Confluence, and Bitbucket.

  • Receive updates about version updates from Atlassian Marketplace applications.

Short demo

Below you can see a short demo on how to configure Bitbucket Slack integration.

Project-level configuration demo

Frequently Asked Questions

Slack integration with Bitbucket Frequently Asked Questions

Configuring Bitbucket Slack notifications

Slack configuration

You need to create an incoming webhook in Slack. Go to slack home using a web browser, and select Add Integrations. Scroll to the bottom, and select Incoming WebHooks (click on Add). This will generate the hook URL.

Repository configuration for Slack notifications from Bitbucket

There are 3 places for the configuration. First is the global setting page that you can access from the Bitbucket administration. The second one is in the Project settings, which covers all repositories of a particular project. The project-level configuration works well for smaller Bitbucket projects or when a team owns a project.

On the repository level, you can override repository-specific preferences and settings to narrow down events.

Below you can see pull request notifications.

Bitbucket repository push notifications.

Branch filters

Additionally, you can set up Channels and branch patterns. Using this setting you can configure which Slack channel should be used for notifications about events in the particular branch(s).

It accepts a single channel name (example: #it-admins), or you can add a comma-separated list of pairs (pattern->channel). In this case, the format must be PATTERN->CHANNELNAME, ANOTHERPATTERN->ANOTHERCHANNELNAME. The pattern will match against the current ref name ignoring the "refs/heads" part. For instance, if you want to match refs/heads/bugfix/mybug42 and all other bugfix branches, add a pattern as bugfix/.* You can also leave it empty. When empty, the default channel will be used within the webhook.

Note: the branch filter is an event destination branch (“to” branch selected by default). It is important for some pull request events.

For instance, if you want to be notified when the pull request is merged and filtered by branch. You have to use the destination branch (“to” branch).

The “from branch” is used to filter by the source branch. Normally, it is used for pull request activities.

For example, I’ve got a branch issue/DEV-564-slack-card-refactoring and I want to receive notifications about PR comments to slack into my channel. I will set up `issue/DEV-564-slack-card-refactoring->#pull-request-comments`.

You have the option to enable notifications on a per-repository basis. Go to your repository settings page, select Slack settings and enable pull requests and/or push notifications with the checkboxes. You can override here the default global settings.

Additional filters

There are 4 additional filters are present:

  • users that triggered the events (users whitelist).

  • users that triggered the events and should be ignored (users blacklist).

  • user groups a user that had triggered an event should belong to (user groups whitelist).

  • user groups a user that had triggered an event should belong to and will be ignored (user groups blacklist).

Override settings for global slack notification options - If enabled, Slack notifications will use the settings defined on the repository level instead of global settings. This flag overrides pull request filters or push notification options.

If you enable the flag, you MUST set a channel name as well (only the hook is not required).

Here is an example screenshot about the push notifications:

Add reviewers to the compact and minimal message types

There is a setting that controls whether the reviewers are added to the minimal and compact messages. It is present on all three levels.

This is how it looks when the setting is on.

Happy Slack notifications!

If you have any questions please let us know.

Version updates Slack notifications (global settings)

Global administrators can receive Slack notifications for new releases of major Atlassian products and Atlassian Marketplace applications.

By clicking on the new version of the app you are redirected to the change logs of a particular application or plugin.

The configuration looks like this:

You need to configure where you want to get notifications, for which Apps and when (schedule it). Don’t forget to enable change log notifications.

If you have any feedback about this feature please do not hesitate to reach out.

Debugging

You need to enable debug mode for Bitbucket and supply us with the support zip or Bitbucket log file.

Updated: