Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Specs - Pull request created plan branch on wrong plan



I've got a repository in Stash / Bitbucket Server. Let's say it's in a project called FOO, and the repository is named bar. It has a develop and master branch.

In Bamboo Server, I've got a linked repository corresponding to each branch:

FOO / bar / develop
FOO / bar / master


I created a Specs (a .java) such that it contains definitions for two plans - one for the develop branch and one for the master branch. I pass the string corresponding to the linked repository to each Plan generator:

public Plan createMasterPlan() {
.linkedRepositories("FOO / bar / master")


public Plan createDevelopPlan() {
.linkedRepositories("FOO / bar / develop")




Later on, I decided to add plan branch management to each. However, on the master plan, I specified createForPullRequest and on the develop plan I specified createForVcsBranch.

I also have Stash configured to retrieve Bamboo build statuses and attach them to commits.  While creating a branch in Stash creates a plan branch on the develop plan as expected, pull requests to develop create a plan branch on the master plan. 

I'm not particularly sure how to explain this behaviour. I'd like for pull requests to develop to not create a plan branch for master. I assume this happens because of the mismatched plan branch management definitions. Can anyone confirm? Anyone else seen behaviour like this before?



I just changed the plan branch management definitions in my Specs to use createForPullRequest for both.

Apparently this has the same problem: the pull request I create causes two plan branches to be created - one for develop, one for master.

1 answer

1 accepted

1 vote
Answer accepted

Hi @joshuayhloCW

Firstly, thank you for your detailed issue description of this question.

Moving to the answer part, I have to say that this is the expected behavior. The createForPullRequest configuration will create a new plan branch for any pull request submitted to a plan that references the source repository affected. In other words, if you create a pull request to develop or any other branch, all plans referencing the affected repository will get a new plan branch.

Linked repository clarification

The branch you use for a linked repository will only define what will be the default branch for that plan. It will not restrict the plan branch creation to that branch. This is the same behavior you see when you configure both plans to createForVcsBranchand create a new branch, which will create the new branch in both of them.

Feature requested

We have a couple of users that see this as a limitation in the pull request feature and therefore created a feature request to add a regex expression to this feature so you can decide in which conditions the pull request would be created. A similar feature already exists to createForVcsBranch option. This is the one:

There is no workaround for this at the moment. If you cannot have pull requests from other branches created in that same plan, the only option I see is disabling the createForPullRequest feature.

I hope I was able to clarify this scenario.

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events