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

Having issue with Bamboo REST API vcsBranches

TedT January 14, 2013

Trying to get the branch name/number from the REST API. I am calling https://myInstalledBamboo/rest/api/latest/plan/{Projec-Key}-{Build-Key}/vcsBranches.

It is returning:

<branches size="2" max-result="2" start-index="0">
<branch name="--hooks--"/>
<branch name="master"/>
</branches>

But if I got into the plan configuration, I see the actual branch used for the Project-Key-Build-Key is "release/1.1" This call was returning correct data in the past, but recently broke (but don't know the exact date it broke).
Interestingly it returns this same data if I use a valid Build-Key or some invalid values for Build-Key. Key = 355114 works (and we don't have that many builds on this plan), but Key = 1543e fails with invalid key message.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Krystian Brazulewicz
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 14, 2013

Hi Ted

From your description it looks like you're using something like this as your URL:

https://myInstalledBamboo/rest/api/latest/plan/BAM-BOO-355114/vcsBranches

this is not correct and you should use

https://myInstalledBamboo/rest/api/latest/plan/BAM-BOO/vcsBranches

which should return the same result.

First let me explain some terminology we use. For a given Plan with key BAM-BOO, the BAM part is the {Project-Key}and the BOO is {Build-Key}. Some of the REST endpoints also make use of numerical value which is usually referred to as {Build-Number}.

The REST enpoint you're using, lists names of all branches detected in the VCS configured for your plan (not only these configured in Bamboo). If you believe that this list is incorrect then please double check Source Repositories configuration for your Bamboo Plan to verify if correct repository is configured.

In case you still see a difference between the data that Bamboo provides and what you can see in your repository please create an issue on https://jira.atlassian.com/browse/BAM where you specify Bamboo version you're using and attach screenshot of your Plan's Source Repositories configuration and a dump/screenshot from a tool that presents a list of branches in your repository.

Cheers,

Krystian Brazulewicz

Atlassian Bamboo Development

TAGS
AUG Leaders

Atlassian Community Events