Using a bamboo variable in git repository branch configuration

Is there any way to use a bamboo variable for the branch name when configuring a source repository?

I would like to be able to specify the tag name to fetch in a variable when releasing a version from JIRA.

2 answers

0 vote

You can use variables in the repository configuration, but the caveat is, the repository configuration needs to resolve to sth. that exists.

So if the tag already exists when you trigger the build it should work.

But if you create the tag during the build it won't work, as Bambo will try to find the revision on tag that not exists yet.

There might be a workaround but I haven't tried that:

- define repository with a variable in branch field

- set that variable to 'master' (or whatever that works)

- before checking out, use this Task: to change the value of the variable

I created the tag in the stash repository before doing the release from JIRA. I tried to run the release with the repository branch name set to ${bamboo.jira.version} but it didn't seem to parse the variable, saying it couldn't find the branch '${bamboo.jira.version}'. I tried the same with a custom Plan Variable but got the same result.

Yes. We use a variable called and use it as ${} in the branch area

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
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,802 views 0 6
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