I may not be able to provide a lot of information, but here's what I know.
I have a build job that is designed to build master or pull request branches, depending on a custom branch parameter. I also clone the job for each current release branch we are working on. The job specifies a "Pipeline script from SCM" and specifies the git repo we are using, and the branch (master or release).
We use BitBucket, and the "Bitbucket Server Webhook to Jenkins", along with the "Pull Request Notifier" in BitBucket. When we create pull requests, the PRN works fine and causes Jenkins to run the job on the pull request branch.
When we merge a PR to master, or a release branch, most of the time it does not spawn a build of the master or release branch. Today I may have discovered the circumstances that result in it spawning a build on a merge.
If no build is currently running, the merge to master does not spawn a build.
If a build of the master branch is currently running, the merge to master does not spawn a build.
However, if there is currently a build running of a pull request branch, the merge to master DOES spawn a build (makes it pending) of the master branch.
I've tested this several times today, although only with a single pull request branch. I would find it hard to believe it matters which pull request branch it is.
In our testing, we haven't really been merging PRs to master each time, we simply recorded the "notifyCommit" URL and we've been manually running it with "curl".
So, for instance, we would run something like the following:
I've reused this exact command line for my tests. If a build is not running, or a build of master is running, I get the following output:
If, however, there is a current build with job on a pull request branch, it gives me this (where "foo" is my job name):
And this results in a job being started.
Note that we're using a somewhat older version of Jenkins. We've decided to upgrade to
2.56.2, but we have no certainty this problem will go away in that version.
I'm not the admin for the server, but if more information is needed, the admin can either comment on this, or I can get required information from him.