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

Next challenges

Recent achievements

Recognition

  • Give kudos
  • My kudos

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Bamboo Specs - java, create plan branch

Is there a way to create a plan branch with the java spec api?

I don't see any examples here:

https://docs.atlassian.com/bamboo-specs-docs/6.4.0/specs-java.html

 

And I can't find anything here:

https://docs.atlassian.com/bamboo-specs/6.4.1/?_ga=2.194413293.1722865494.1522673805-876250858.1520866475

2 answers

1 accepted

0 votes
Answer accepted
rsperafico Atlassian Team Apr 03, 2018

Hello @Tom Adamo,

Please, refer to "Manual branch management" under https://docs.atlassian.com/bamboo-specs-docs/6.4.0/specs-java.html#automatic-branch-management

Kind regards,

Rafael

This is creating separate plans for each branch, not plan branches, no?

0 votes
Minh Tran Atlassian Team Apr 05, 2018

Or you can refer "Automatic branch management" part the https://docs.atlassian.com/bamboo-specs-docs/6.4.0/specs-java.html#automatic-branch-management

Here is one example

Plan plan = new Plan(project, planName, planKey)
    .planRepositories(new GitRepository()
        .name("my-repo")
        .url("ssh://git@bitbucket.org:my-company/my-repo.git")
        .branch("master"))
    .planBranchManagement(new PlanBranchManagement()
        .createForVcsBranchMatching("^JIRA-[0-9]+")
        .triggerBuildsLikeParentPlan()); 

Feel free to ping me if you have other questions

Thanks.

I want to get them created, not configure the settings. This part (sort-of) answered my question: https://docs.atlassian.com/bamboo-specs-docs/6.4.0/specs-java.html#manual-branch-management

Minh Tran Atlassian Team Apr 05, 2018

@Tom Adamo Not really. The above code registers the plan to a specific branch pattern "^JIRA-[0-9]+", when a new branch matching that pattern is created, a branch in Bamboo is created for it. That is how it work.

Unless you want to create your branch in Bamboo manually when your branch in SCM is created everytime, then this is not what you want

I already have a repo with existing branches. So, I don't want to just configure the branch management. I want to actually create a plan branch from a script.

Your example will configure the plan to wait until a repo branch (JIRA-1) is created, then it will create the corresponding plan branch. But, I already have the repo branch (JIRA-1) created and I don't want to have to go into the UI and create the plan branch manually.

Suggest an answer

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

Bamboo 7.1 is here and is packed with value!

I'm happy to announce that Bamboo 7.1 has been released and it’s overflowing with awesome new features. Top-voted issues First and foremost, a bunch of JAC top voted issues has been delivered - y...

675 views 1 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