Bamboo plan with a variable which depends on another variable, it works in some circumstances

I have a bamboo plan with a maven task. I need to pass a maven parameter with the name of the branch.

I can use the variable ${} for this.

However, I need to override this value for some branches (see

So, in my bamboo plan I define a variable called "branchName", with value "${}".

then, my maven task uses ${bamboo.branchName}, and the branches can override the "branchName" value when neceserary.

So, is this possible? can my bamboo plan variable "branchName" use another variable "${}" as default value?

Well, I tried, and the result is unclear.

If my maven task is:

mvn verify -B -Dsonar.branch=${bamboo.branchName}

this does not work. it executes mvn verify -B -Dsonar.branch=${}


If my maven task is:

mvn verify -B -Dsonar.branch=${bamboo.branchName} -Dignore_var=${}

then ${bamboo.branchName} gets substituted as expected,

and it executes mvn verify -B -Dsonar.branch=develop -Dignore_var=develop

Why is that? Is this a bug or a feature?

So, how to achieve this correctly?

that is, I need a bamboo plan variable "branchName" with a default value of "${}",

which can be overridden by branch plans.

2 answers

You may want to try the nested plugin. That way you could set a variable to "${}" but when evaluated it will give you the value of the inner variable.

thanks, we'll try that.

Suggest an answer

Log in or Join to answer
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,096 views 0 5
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot