Can I edit the Bamboo build number?

Frank Schimmel October 5, 2014

Hi,

I am evaluating options for encoding the sprint/iteration no. into the 4th digit of our software version scheme.

Is there a way in Bamboo's plan configuration where I set the offset for the Bamboo build number before the next build starts?

Many thanks in advance!

Frank

 

3 answers

1 accepted

3 votes
Answer accepted
Krystian Brazulewicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 5, 2014

Update: please see our knowledge base article for the updated workaround.

Also if you want to track the progress of our work on this suggestion watch/vote on BAM-10282.

 

I'm not sure if I understood your question correctly, but if you're asking if you can change the "next build number" for a plan or branch then it only possible by direct DB manipulation:

UPDATE build SET next_build_number = X WHERE full_key = <your-plan-key>

warning Please make sure you create full DB backup before executing any manual modifications.

Frank Schimmel October 5, 2014

Thank you for the immediate answer. The SQL statement will do exactly what I was looking for, but I hoped this would also be supported in the Web-GUI, which is - as you write - obviously not the case.

ksondere March 29, 2018

Is this still the best way to do this?

 

I see some suggestion on the Internet that the build number cannot be lowered but must always be raised.

Is that true?

yogesh_devi
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 12, 2019

Thanks for this information @Krystian Brazulewicz  ; Please note that  Bamboo schema has changed since this post.

I  use Atlassian Bamboo version 6.8.1 .

I am describing what I did to achieve same effect with new schema I so it may save time for others .

The table that maintain build numbers in  newer versions of Bamboo is called "BUILD_NUMBERS" 

To make a determination  of per plan next build number corresponding to title or from plan key I used this join 

"select TITLE, FULL_KEY, BUILD.BUILD_ID , BUILD_NUMBERS.NEXT_BUILD_NUMBER from BUILD, BUILD_NUMBERS where BUILD_NUMBERS.BUILD_ID=BUILD.BUILD_ID;"

And then to update BUILD_NUMBERS - I ran following query 

UPDATE BUILD_NUMBERS SET NEXT_BUILD_NUMBER = <desired build number> WHERE  BUILD_ID =<plan id  for your plan that you figured from above query >

 

Like Daniel Santos likes this
Krystian Brazulewicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 17, 2019

@yogesh_devi you might want to see proposed workaround in https://jira.atlassian.com/browse/BAM-10282 which links to knowledge base article on this subject: https://confluence.atlassian.com/bamkb/unable-to-change-the-current-build-number-in-bamboo-759858218.html

Like yogesh_devi likes this
1 vote
Oleg Efimov September 14, 2017
0 votes
yogesh_devi
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 12, 2022

I also tried a third party plugin # Build Number Manager for Bamboo available on atlassian marketplace and that helps me solve my purpose.

This plugin provides a feature called  "Enable plan / branches build number synchronization" that can be enabled or disabled on  any build plan

When turned on this  feature ("Enable plan / branches build number)  causes  every branch build on the particular build plan  to have unique build number that increments from the highest build number in plan branch.

So for example if your plan branch has build number 555 when you enable this feature, and then you build on another branch in that plan . In that case the branch build will have a build number 556 or more. In other words the increment in build number transcends all branches ( not just the plan branch ) .  While this is useful in ensuring every build on a plan has a unique number regardless of branch - it causes build number skyrocket on a large team  so has to be used with discretion.  And also the plugin comes with a price tag

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events