Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Run Bamboo Plan branch just once


We have a Bamboo plan set up to create plan branches that is triggered whenever is new feature branch is created in Bitbucket (it is set up to monitor Bitbucket). We only want that plan to be executed once (when a feature branch is created) because it is used to create an sfdx scratch org.

However, the problem is that Bamboo kicks off the branch plan whenever a change is committed to the feature branch. How do we turn that off?




3 answers

1 accepted

Hi @Jozef Vandenmooter , 

we can achieve the above requirement in the following way.

  • Add the Bitbucket Server repository triggered trigger in the plan configuration and disable it in the Plan Configuration
  • In the Branches under plan configuration, select the option same as defined in the parent plan for Branch triggers option.
  • Configuring the plan configuration with the above steps will meet the requirements.

Please let me know if you need any other help :)



Works great - thanks Poorna! 


I haven't actually verified this myself, but am confident that you can achieve this with the Conditional tasks for Bamboo app, which allows you to Control task execution by variables and as a use case specifically references that you can Skip build steps in plan branches.

Given that each branch starts with build number 1, you should be able to use the resp. Bamboo variable ${bamboo.buildNumber} and skip the task if it doesn't match.

You can find more details about this app in @Daniel Santos' excellent answer to How we can configure job with conditional tasks for bamboo Plug-in?

As Daniel emphasizes, the app is currently listed as unsupported under Atlassian Labs, but given its importance and success, and how this has been handled in the past, I'm fairly optimistic that Atlassian will at least maintain it, and maybe even promote it to a built-in Bamboo feature down the road. Please watch and vote for the following issue to further increase Atlassian's priority for an official solution regarding this highly voted feature request:

Hi Steffen,

Thanks for the reply. That looks like an awesome plugin indeed.


However, wouldn't the plan still kick off and create a log even if the Tasks are not executed? As I said, we don't want the plan to be kicked off at all anymore once the initial run created the sfdx scratch org.


Like Steffen Opel _Utoolity_ likes this

Hey @Jozef Vandenmooter
I just want to add another idea as a second option.

You could configure the plan branch to disable itself when it runs for the first time. For this, you would need to create a script task at the end of your build with a bash script like:

# If this is not the main plan branch
if [ ${bamboo.planRepository.1.branch} != '<DEFULT_SOURCE_REPOSITORY_BRANCH>' ]
# Disable this plan branch
curl -k -u <USER>:<PASSWORD> -H "Content-type: application/json" -X DELETE <BAMBOO_URL>/rest/api/latest/plan/${bamboo.planKey}/enable

The problem with this approach is that you will need to have credentials in your build in order to run the rest API to disable the plan. You can add them as password variables, but they would still be available in your build.

I would stick with @Steffen Opel _Utoolity_'s option if you want to avoid some of the build tasks but still want to run the build for the plan branch.

Like # people like this

I wrote the message above without seeing your last response... I guess it still applies to it =]

Like Jozef Vandenmooter likes this

I believe you :)

Thanks a bunch! 


Like Daniel Santos likes this

Hi Jozef,

Your question about a skipped task still being logged has been implicitly answered by @Daniel Santos I guess, that's indeed the case - his clever solution is spot on accordingly (see PS for an alternative that avoids the credentials issue)!

Out of curiosity, may I ask why the logs are an issue? Incidentally the resp. extension point for a Build Trigger Condition module actually fulfills your requirement, i.e. "A build which fails the trigger condition will not be executed, there will be no trace of the existence of this build".

However, we (Utoolity) have a backlog story for our Automation with AWS (Bamboo) app to implement such a build trigger condition that will call out to AWS Lambda, but the users we have talked about this so far always want to have some trace regardless, which renders the story considerably more complex for us because we'd need an audit log.


PS: Btw., if you happen to use AWS and do not want to make the credentials available to your build, you could use our (commercial) Invoke Lambda Function action to interact with the Bamboo REST API remotely, which means you can securely store the required Bamboo credentials in the Systems Manager Parameter Store.

Like Daniel Santos likes this

Thank you, @Steffen Opel _Utoolity_, for adding an option to securely store the credentials.

Hello. There's much simpler solution to run only first build of new branch. It's possible to configure triggers for new plan branches. Go to Plan configuration -> Branches. Then choose None trigger. Bamboo will create new branch, run initial build and then do nothing.

Screenshot 2019-06-24 at 12.17.17.png

Update. My mistake. It doesn't work. Branch is created, but first build is not executed.

Right - that was the first thing I tried  :)

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events