Have you wondered how not to always jump into Bitbucket to see if your PRs are approved/rejected, Bitbucket pipeline failed, or a pull request created in a repo where you are an owner?
With Microsoft Teams Bitbucket Connector, you can configure the rules when you want to get notifications. You need to install it in the Marketplace, which is available in the Settings of your Bitbucket Workspace.
To begin with, you need to create an Incoming Webhook Connector standard Connector from Microsoft Teams.
How to get Microsoft Teams notifications from Atlassian Bitbucket Cloud
As a result, you will get a webhook URL that is used to receive notifications.
Create a notification rule for the pull requests in the settings of your repository.
If you want to filter by the destination branch, you need to have a JavaScript regular expression which is checked against the destination branch. The simplest form is to actually create a rule per destination branch. F.e. if you need to get notifications when there is a pull request or a push towards master or release-candidate-XXX branches. You can create two rules with the destination branch filters: master and release-candidate.
To get notified about build status updates, you need to watch the commit status updates. Bitbucket does not differentiate how the status was updated (via the Bitbucket own pipeline or a 3-rd party continuous integration system like CircleCI or BuildKite).
You need to create a rule in Microsoft Teams Bitbucket Connector.
As a result, you will get the following notifications in Microsoft Teams.