Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to set a custom branch key id in Bamboo?

By default, when I create a new branch, it gets plan keys as MAINKEY0, MAINKEY1, MAINKEY2, etc.

Is there a way to customize this so I can have more meaningful names, e.g. MAINKEY_FEATURE1, MAINKEY_FEATURE2?

1 answer

1 vote

Hi @cirosantilli

Bamboo doesn't provide a way to customize this. I believe it would require dramatic changes in the way we reference plans/branches internally on DB.

The best I can provide to you is a query where you can get a clue of what you build on that plan branch. I say a clue because the real source branch is saved on a more complex structure on DB to allow plan branches to diverge from the main configured source repository.

This is the query that may help you:

SELECT title,
      description,
full_key
FROM build
WHERE build_type='CHAIN_BRANCH'

I hope it helps.

Thanks for the reply Daniel. I'll continue copy pasting branch IDs on the browser address bar for now I guess :)

I don't know what exactly is the navigation issue you are trying to mitigate, but if it is moving between branch results, could the branch dropdown beside the plan name help?

We use the branch IDs in filenames to store test results in unique places with bamboo_ variables. If you look at the filesystem, you don't immediately know what the directories are for.

Got it! 
Do you think it would be useful if you concatenated the branch name as well to produce the file/folder name?
It is available in this variable:

bamboo.planRepository.<position>.branchName

It would allow you to easily identify the plan branch affected.

I'm looking into adding branch name to paths. It would help if the "master branch ID" MASTERID were visible in the secondary branches in a variable. Currently we only see separate ids for the secondary branches: MASTERID1.

With that, I would more cleanly reach the optimal file structure:

MASTERID/$bamboo_planRepository_branch/$bamboo_buildNumber

without sedding off the numbers at the end of MASTERID1.

Hi @cirosantilli

There is no variable with this information available out of the box, but we could build it from the ${bamboo.planKey}.

I would use a command like:

echo ${bamboo.planKey} | sed -E 's/([A-Z0-9]+-[A-Z]+)[0-9]*/\1/g'

⚠️Please notice that you might need to adjust the sed command configuration depending on the operating system used.
Another important point to take into consideration is that you should not have plan keys with numbers in the master branch (which usually is not the case, at least Bamboo will not suggest a plan key with a number when creating the plan).

Please let me know if there is anything I can still assist you in this.

Thanks Daniel, I considered that sed, and it would work most of the time, but it would fail if the master bamboo.planKey ends in digits however.

Hi @cirosantilli, yes I know. The DB and the Sed are the only options I see at the moment. I hope you don't have any plan key with numbers. They will never be suggested by Bamboo... but can be deliberately created if a user decides to do so.
You can check if there is any like that using the query below:

SELECT title,
description,
full_key
FROM build
WHERE build_type='CHAIN'

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

223 views 4 6
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you