Access branch display name as a Bamboo variable?

In git we name our feature branches "feature/whatever". When displaying branch names, Bamboo turns this into "feature-whatever". I'd like to be able to pass this "display name" into the build to use as part of a version stamp (Maven chokes when you try to pass it a slash since it wants to use the version as part of the path).

I can think of several ways to avoid the problem altogether, but I first wanted to check whether there was simply a variable I was missing that would give me the value I'm looking for.

3 answers

1 accepted

This widget could not be displayed.

${bamboo.shortPlanName} seems to be what I was looking for, although I don't see it listed in the documentation (https://confluence.atlassian.com/display/BAMBOO/Bamboo+variables).

I'm a little disappointed this is an accepted answer. It isn't answering the actual question of "How to get the display name" as a variable.

for whatever weird reason, bamboo.shortPlanName does seem to give the branch name with the "/" replaced by "-" . . . 

This widget could not be displayed.

Not sure how ${bamboo.shortPlanName} gives you the branch name, that's the name of the project or build plan. But I guess if it gets what you wanted.

We obtain the branch name from ${planRepository.branchName} or ${planRepository.branch}.

Both of those variables give the "real" branch name containing the slash (feature/whatever, not feature-whatever as displayed by Bamboo). I'm by no means suggesting that behavior is wrong, it's just not what I want in this case.

I got branch name with ${bamboo.planRepository.branchName}, not ${planRepository.branch}

This widget could not be displayed.

Understood.

Just a note, the slash "/" can be set to a dash "-" in the branch. That's configured from Stash (Branching model under repository Settings).

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

46 views 1 0
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