Atlassian Bitbucket Integration plugin triggers builds for multiple branches
A push to Bitbucket triggers builds for multiple branches, not only the branch that has received the most recent push.
Official Atlassian Jenkins integration plugin checks Bitbucket Server for any changes in a repository with a configured webhook to Jenkins since the last build was triggered. If a change is found - it builds all the branches that have changed.
Let’s consider a situation:
A user pushes a commit to branch FEAT-1.1.1.
An Auto-merging feature is enabled propagating the changes to FEAT-1.1 and Release branches.
Jenkins builds branches FEAT-1.1.1, FEAT-1.1, and Release.
Jenkins instance is brought down for maintenance.
A user pushes changes to branches FEAT-1.1, FEAT-2.0, and BUGFIX-456.
Jenkins instance is brought back up.
A user pushes changes to branch FEAT-2.0.
Branches FEAT-1.1, BUGFIX-456, and FEAT-2.0 (the most recent commit) will be built in Jenkins.
Once the push to FEAT-2.0 happens and communication between Bitbucket Server and Jenkins is up and running again, the Jenkins plugin will scan the whole repository in Bitbucket Server for changes since the last scan. It should discover updates to not only the most recently updated branch but also all the others not built yet.
If your intention is to build a specific branch, feel free to use Branch Specifier in 'Branches to build' in Jenkins build configuration: