An email server must be configured in Bitbucket Server for email notifications to be sent. See Setting up your mail server. Note that if the mail server fails, notifications will be dropped. See also HipChat notifications.
Pull request notifications
Bitbucket Server sends email notifications to the watchers and reviewers of a pull request when the following events occur:
|Pull request event||Notification|
|A reviewer is added||IMMEDIATE|
|A comment is added||BATCHED|
|A comment is edited||BATCHED|
|A comment is replied to||BATCHED|
|A commit is made to the source branch||BATCHED|
|A pull request is opened||IMMEDIATE|
|The pull request is approved||BATCHED|
|The pull request is merged||BATCHED|
|An automatic merge fails||IMMEDIATE|
|The pull request is declined||BATCHED|
|The pull request is reopened|
BATCHED or IMMEDIATE
By default, email notifications are batched. However, in the following situations notifications are sent immediately:
- When a pull request is first opened, notifications are immediately sent to the reviewers.
- When a pull request is reopened, notifications are immediately sent to the reviewers who have opted in for immediate notifications.
- When someone is added as a reviewer to a pull request, a notification is immediately sent to them.
- When someone is mentioned in the description of a pull request, a notification is immediately sent to them.
You can change your personal account settings (on the Notification settings tab) so that you get notifications immediately.
You don't receive notifications for events you initiate yourself. See also Using pull requests in Bitbucket Server.
Batched email notifications
Bitbucket Server sends email notifications to:
- the watchers of a pull request, when certain pull request events occur,
- those who are mentioned in pull request descriptions or comments,
- comment and pull request authors when their comments get liked.
Notifications are aggregated by user for each pull request and are emailed in a batch. The batch gets sent if things go quiet for a while (10 mins by default), or when the oldest notification gets 'stale' (30 mins by default), whichever comes first.
By default, email notifications are batched. However:
- You can change your personal account settings (on the Notification settings tab) so that you get notifications immediately.
- A Bitbucket Server admin can configure the period of inactivity and the staleness timeout period in the Bitbucket Server config properties file.
- A Bitbucket Server admin can change the notification mode for the Bitbucket Server instance to 'immediate' using a system property, but users can still opt in for batched notifications.
Using 'mentions' to notify someone
From Bitbucket Server 2.0 you can use 'mentions' to notify another Bitbucket Server user about the pull request description or comment you are writing. Bitbucket Server sends an email to that person – the emails are batched if they have opted for batching in their personal account settings.
To use mentions, simply start typing '@' and then the users display name, username or email address, and choose from the list that Bitbucket Server offers. You can use quotes for unusual names, for example if it has spaces. Use Control-Shift-P or Command-Shift-P to preview the mention.