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 do you refer to a Branch's artifact if you do not know the branch "number" beforehand?

I'm trying to setup a build that pulls artifacts from several other parent builds and am having some trouble figuring out how to correlate the branch "id" for a specific plan (the integer appended to the plan key) with the branch name. The variable $bamboo.repository.branch.name seems to only contain the branch name from the version control repo.

For example, I have two branches, master and release. master's "id" is 0 and the Plan name looks like MYPLAN0 while release's id is 1 and the plan name looks like MYPLAN1.

Is there a way to easily refer to branches in Bamboo by the version control branch name? Is there some variable that makes it easy to generate a URL to the corresponding branch of another Plan? Dependencies are capable of being linked based on plan name, but I can find no way to actually pull in artifacts.

Ideally, it'd be as simple as MYPLAN/branch/master or MYPLAN/branch/release and then all routes normally following MYPLAN could instead follow the branch name.

3 answers

1 accepted

Oh, and there is a ticket in the Bamboo issues tracker that you might be interested in: https://jira.atlassian.com/browse/BAM-12154 - basically it is the same feature request you would like to have, isn't it? Might be a good idea to add yourself as a watcher/voter to that issue.

Hi,

I'd try a REST api to obtain a proper branch-plan. AFAIK there is REST resource in Bamboo that for a given master-plan key and for a given branch name will return you in the response the relevant plan-branch key. Probably you could use that to craft the necessary urls by yourself... or maybe not.

The REST resources I'm thinking of are:

* http://docs.atlassian.com/bamboo/REST/4.2-SNAPSHOT/#idp85888 plan/{projectKey}-{buildKey}/branch/{branchName}

* http://docs.atlassian.com/bamboo/REST/4.2-SNAPSHOT/#idp113040 /plan/{projectKey}-{buildKey}/vcsBranches

regards,

More or less that ticket would do what I'm asking for, yes. Will add myself as a watcher/voter.

Guess I'll try the API too.

Suggest an answer

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

Unable to add or edit Bitbucket Cloud repository in Bamboo

On 31 May, a GDPR-related change went live in the Bitbucket Cloud API that resulted in users not being able to create or edit Bitbucket Cloud Linked repositories in Bamboo. This API update removed t...

312 views 2 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