Plan branches for feature branches


I have a plan (based on master) which is configured to poll the repository for changes.

Currently i have manualy added an existing branch (develop) to the plan that will use the same configuration of the plan.

Im my use case, the feature branches should execute a slightly different build - hence the tasks are different. Since plan branches can't have different stages / jobs / tasks than the plan, i have decided to create another plan - just for feature branches.

Since feature branches are created on the fly, the plan is again based on the master plan.
I want that the plan will be triggered by polling the repository, but i only want the plan to be triggered for the feature branches - not the master branch.

If i don't create a trigger in the plan, i will need to manually create a trigger for every feature branch that will be detected by Bamboo - which is not feasable.
If i create a trigger for the plan, then any change to the master branch will trigger both the original plan and the feature branches plan which I also don't want.

Is there a way to overcome this?

If not - can a feature be added that you can configure stuff in the plan but tick a checkbox that will say to only apply this on plan branches?



2 answers

0 votes

Hi Moti,

Thank you for your question.

I would suggest you on having a look at Bamboo Variables where you can check which branch the commit was originated from.

# please, create a new Script task in your plan and paste in the following:
echo " ${}"

Kind regards,

Hi Rafael,

I am aware of Bamboo variables and also use them in my plans.

I'm not sure however how this helps my scenario - Assuming i want to use tasks rather than scripts - there is no option to define conditions for task execution as far as i know.

Also, since i want to use triggers (which are not able to use variables) that will only be applied on the branches without me having to set them manually for every branch - i don't see how that helps in this scenario also.


Hi Moti,

You are able to use Bamboo variables as a parameter for different Task within Bamboo and as you have mentioned "...the feature branches should execute a slightly different build..." so you could you the branch variable and compare if that branch is the one to run a particular Task.

Imagine that you are running a Maven task, you could use the branch name as a Goal and make your xml to perform what is meant to do based on that branch/Goal.

Kind regards,

Hi Rafael,

I am using bamboo variables in tasks, but how do i achieve this in a single plan:

master / develop / release branches should use "clean deploy" as maven goals while my feature branches should use "clean compile". how do i configure this using bamboo variables (without manually adding plan variables to feature branches)?



Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

68 views 3 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you