-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major
-
Component/s: atlassian-bitbucket-server-integration-plugin
-
Environment:Jenkins: 2.401.3
Bitbucket Server Integration Plugin: 3.6.0
Bitbucket Server: 7.21
Hi,
we have a pipeline configured with the following trigger

and:

Â
And in Bitbucket, webhook looks as follows:

This basically means we want to have pipeline executed every time something is pushed to "master" branch only.
However we noticed that the pipeline is also triggered when:
- any new branch is created
- or any new push to those other branches is performed
In both cases the event triggered by Bitbucket is :Â
X-Event-Key: repo:refs_changed
"changes": [ Â Â Â Â { Â Â Â Â Â Â "fromHash": "c3a812f6132fb289616d1dfd2ea5d431fcca2553", Â Â Â Â Â Â "ref": { Â Â Â Â Â Â Â Â "displayId": "feature/anothertest", Â Â Â Â Â Â Â Â "id": "refs/heads/feature/anothertest", Â Â Â Â Â Â Â Â "type": "BRANCH" Â Â Â Â Â Â }, Â Â Â Â Â Â "refId": "refs/heads/feature/anothertest", Â Â Â Â Â Â "toHash": "bd191884f531a371688d3c9b3248a8a573f3d74d", Â Â Â Â Â Â "type": "UPDATE" Â Â Â Â } Â Â ], ...
Â
So it seems "Branches to build" is completely ignored and not taken into consideration when triggering the job.
Could you please check if it is a bug indeed or it works as designed?
Â
Edit:
One more thing to add regarding "Branches to build". It also seems that when we use env variables (ie. GIT_BRANCH) they are not evaluated later on.
In result we can see the following at the very beginning of the job:
git rev-parse refs/remotes/${GIT_BRANCH}^{commit} # timeout=10
and git, of course, fails to get anything.
Not sure if those two things are related, just sharing so you have a full picture.