We'll help you & your colleagues stay up to date with everything happening in your Bitbucket. You'll will always know:
- If that pull request got approved
- When the build finished and if it succeeded or failed
- When a new branch is added to a repository
- Much more
Even better, some notifications allow you or your colleagues to take an action right from a notification:
- Nudge outstanding reviewers on your pull requests
- Reply when someone makes a new comment on your issue tracker, a commit, or pull request
- Merge that pull request now that it's approved
- Re-run a failed Pipelines build
All that should get you and your colleagues started. We'll be building more awesome into this app based on your feedback!
Install the app
- Open the repository you wish to configure notifications for.
- Click Repository settings then select Chat notifications > Settings.
- Press the Connect button under Slack. A dialog for Slack login might open if you are not already logged in.
- Choose the Slack workspace to connect to your repository.
You should receive an automated welcome message in Slack.
If your repository uses the prior Slack integration
If your repository is already set up to trigger notifications for Slack, we recommend that you deconfigure the integration to avoid duplicate notifications. You can stop these notifications from either Bitbucket or Slack.
From Bitbucket, remove the repository's Slack webhooks:
- From Repository settings, click Webhooks.
- Click Delete for the webhooks configured for Slack.
From Slack, remove the Bitbucket app:
- From the Slack App Directory, click Manage.
- Find the Bitbucket app (with the old logo) and remove the app.
Subscribe Slack channels to Bitbucket repositories
Add subscriptions to your Slack channels and choose the specific notifications for that subscription. A subscription links your Bitbucket repository to a Slack channel so you can define which Bitbucket events drive notifications for that channel.
You'll need repository administrator permissions to add or modify notifications.
- Log into Bitbucket
- Open a specific repository to add notifications to, in the account that is connected to Slack.
- Click Repository settings then select Chat notifications > Settings.
Choose one of the following:
- Click Add subscription, if you've already connected this repository to Slack.
Click the connect button, if this the first time your connecting a repository to your Slack workspace.
Click Add subscription and then select Add new workspace, if you’re adding a new subscription, to a new workspace.
- Choose the Slack workspace and channel to connect to your repository.
You can subscribe to additional repositories via Chat Notifications > Settings, or by typing
/bitbucket connect <repository URL> in a Slack workspace that has been previously connected to Bitbucket.
Create subscriptions for private channels
By default, private channels aren't displayed in the channel selector in the subscription creation dialog. However you can create a subscription for any private channel that you have access to by typing
/bitbucket connect <repository URL> within that channel.
Create personal subscriptions
You can also have notifications sent to you by direct message from the Bitbucket Slack bot. To create a personal subscription click on the Bitbucket bot in the Apps section of your Slack's left sidebar, and send it the message
/bitbucket connect <repository URL>.
Set notifications for each subscription
After you've installed the app you can choose specific notifications in the settings for each repository. You can even select specific branches to get notifications from so you only get what you want in your channels.
- Open one of the repositories you connected to Slack.
- Click Repository settings.
- Select Chat notifications > Settings.
- Select a specific branch, set a branch pattern, or select repository wide to get notifications for all branches.
Note: It can be helpful to select specific notifications for specific branches. For example you might not want notifications for every commit from every branch but might want exactly that for your production branch.
- Select the notifications you want for the branch or branches you select.
Branch patterns for notifications
Selecting a branch pattern allows you and any members of your workspace to continuously receive notifications on all new branches which match a specific pattern. This can be especially helpful in branch heavy workflows.
You can set notifications for a specific pattern of branch name like projectname* or a prefix like DEV* or DEV/**/rocket*. for a complete list of patterns use the following cheat sheet:
Glob patterns don't allow any expression to start with a star. Every expression that starts with a star needs to be put in quotes.
Available actions for notifications
Here's a list of the notifications that are currently available.
|Section||Notification type||What it means||Notification actions|
|Repository||Repository notifications will generally include|
|forked||A fork of the repository was made. Forks are copies of the repository like clones but as a completely separate repository.|
|commit comment||Someone commented on a specific commit in the repository.|
Reply: Opens a dialog to reply to the pull request comment.View comment: Opens Bitbucket Cloud to the commit so you can view the full comment.
Pipeline notifications will generally contain:
|The pipeline successfully completed|
|pipeline failed||The pipeline failed||Re-run: Allows you to restart the failed pipeline from Slack.|
|pipeline fixed||A previously failed pipeline has rerun successfully|
|deployment succeeded||The deployment succeeded|
|deployment stopped||The deployment was stopped, this could be manually stopped or automatically paused due to another deployment already in progress|
|deployment failed||The deployment failed or experienced an error condition|
Build notifications will generally contain:
|build succeeded||The build successfully completed|
|build failed||The build failed to complete|
|Branches||Branch notifications will generally include|
A new branch was added to the repository
|branch updated||A commit or series of commits were added to the branch||Create pull request: Opens the create pull request page in Bitbucket Cloud for this branch.|
|branch merged||A branch was successfully merged into another branch in the repository|
|branch deleted||A branch was deleted from the repository|
You will receive this notification if you're subscribed to branch updated notification.
|A change was force pushed outside the normal local to remote ancestry.||Create pull request: Opens the create pull request page in Bitbucket Cloud for this branch.|
Pull request notifications will generally contain:
|pull request created||A new pull request was created|
|pull request updated||Any update to the pull request not already covered in a different notification. Generally whenever someone pushes new changes to the source branch.|
|pull request approved||A member of a workspace added an approval to this pull request|
Merge: Allows you to merge an approved pull request from Slack.
This action will appear if you have merge checks enabled.
Currently the merge button will appear whether or not all merge checks have passed. You will get an error if you begin a merge and the merge checks have not passed.
|pull request unapproved||A member of a workspace has removed approval for this pull request|
pull request merged
|The pull request was successfully merged.|
|pull request declined|
The pull request has been declined and is no longer active
|pull request comment||Someone commented on the pull request|
Reply: Opens a dialog to reply to the pull request comment.View comment: Opens Bitbucket Cloud to the pull request so you can view the full comment.
Tag notifications will generally contain:
|tag created||A new tag was added to the repository|
|tag updated||A a change was made to an existing tag in the repository|
|tag deleted||A tag was removed from the repository|
Issue notifications will generally contain:
|issue created||A new issue was created|
|issue updated||A change was made to one of the issue fields can include updating or adding fields|
|issue comment||Someone added a comment to an issue|
Reply: Opens a dialog to reply to the issue comment.
View comment: Opens Bitbucket Cloud to that issue so you can view the full comment.
You will receive this notification if you're subscribed to issue updated notification.
|The issue is being assigned to a different member of the workspace|
Welcome and administrator messages typically contain:
|Welcome (direct to administrator)||The first message the administrator receives when you complete installing Bitbucket Cloud for Slack. Visible as a direct message to the admin who installs the app.|
|Welcome (open to the channel)||The first message visible to everyone in the associated workspace.|
|New channel response||Automated welcome message when you add the app to a channel. Visible to everyone in that channel.|
|New repository response||Automated message response when a new repository is connected to a channel. Visible to everyone in the channel. Only Bitbucket Cloud repository administrators can take action.||Open repository settings: Opens the settings page for the Bitbucket Cloud repository.|
|Unable to find repository||Automated response when someone attempts to connect a repository and we cannot find the repository with a matching URL.||Open Bitbucket: Opens Bitbucket Cloud so the administrator can locate the repository and ensure notifications are configured correctly.|
Add Slack messages to pull requests as comments
To make responding to pull requests even easier, Slack includes an Action that allows you to add Slack messages as comments to pull requests.
To add a Slack message to a pull request:
1. Hover over the message and click the ••• icon.
2. Select Attach to pull request.
3. Select the repository with the pull request.
4. Select the pull request in the repository.
The message then appears as a comment on the pull request you selected, showing the author and the user who added the message. To gain more context around the comment, click the message link to take you back to the conversation in Slack.
Slash commands for the Bitbucket Cloud for Slack app
There are several slash commands available for the app.
|Command||What it means or does||Required permissions|
|/bitbucket||Manage your Bitbucket Cloud connections and subscriptions|
|/bitbucket help||List the available commands for this app|
|/bitbucket connect <repository url>||Subscribe to your repository to receive notifications|
|/bitbucket login||Link your Bitbucket Cloud workspace to a Slack workspace.|
|/bitbucket logout||Logout from current account to log in as someone else|
Find out what Bitbucket user you are in this workspace
|/bitbucket feedback||Leave us your feedback about the app|
|/bitbucket list||Get a list of all repositories you connected to this workspace|