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 REST API: List all results including branches

Odin Odin Jan 12, 2014

Is there a way to list the latest build results for each plan and also include branch builds?

I.e we are currently using the following endpoint ../latest/result.json?expand.results.result, but it does not include branch builds.

3 answers

1 accepted

1 vote
Answer accepted
Odin Odin Jan 13, 2014

So after digging through your API, we were pleasantly surprised to find the following:

/rest/api/latest/plan.json?expand=plans.plan.branches.branch.latestResult

The ...branch.latestResult node actually contains the build results for every branch of the plan (except for master, strangely), which means we can use this call to get branch results and then use /rest/api/lastest/result.json for the master branch build results.

Now, we could have saved lots of time if this had only been documented in the API documentation.

Jason Monsorno Jan 13, 2014

If every single path of every expand option was documentated the manual would be unreadable. If you really want to do it one call you could use /rest/api/latest/result.json?expand=results.result.plan.branches.branch.latestResult you might also need to include "&max-result=#" where "#" is the number of plans you have/want to include per call.

Odin Odin Jan 14, 2014

It would be nice if at least the main paths had been documented.

The main documentation is severely outdated (https://developer.atlassian.com/display/BAMBOODEV/Bamboo+REST+Resources)

The more detailed, recommended 5.0 API documentation (https://docs.atlassian.com/bamboo/REST/5.0-SNAPSHOT/) is still in SNAPSHOT and if you click "expand" for most of the resources, nothing happens.

1 vote
Odin Odin Jan 13, 2014

Thanks for the quick reply. We have more than 100 builds; this would mean we would have to 1) query bamboo for all plan names and branches. 2) query each plan and each branch for its status. That is a really cumbersome solution.

What we are trying to achieve is to create a simple wallboard with the following requirements: (due to the lack of features in the current Bamboo wallboard)

  • First show list of recently failing builds, including branch builds
  • Then show list of recently successful builds, including branch builds
  • Show currently builds currently in progress (not supported in Bamboo REST API AFAIK)

Have I understood it correctly if there is currently no REST API endpoint that delivers build results including branches in bulk (without having to iterate manually across all resources ourselves)?

Do you have any plans for supporting this?

0 votes
Sepideh Setayeshfar Jan 12, 2014

Hello Odin,

You can find more details about this call on this page: [Retrieve the build results for a specific plan in a project|https://docs.atlassian.com/bamboo/REST/5.0-SNAPSHOT/#d2e593].

1. Select the plan for which you want to get the branch status from the dashboard.

2. Select the branch and double check the "{projectKey}-{buildKey}/branch/{branchName}"

3. Then with a call similar to the following, you will be able to get the build status of the branch:

http://localhost:8085/bamboo530/rest/api/latest/result/TPO-TPO1

In which "TPO-TPO1" is "PROJKEY-PLANKEY/BRANCHNUMBER[NAME]".

You can also add the build number at the end to get information for a specific build on that branch:

http://localhost:8085/bamboo530/rest/api/latest/result/TPO-TPO1-2

"2" is the build number in this example.

Hope this helps!

Best regards,

Sepideh

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Jira Software

Demo Den Ep. 5: Meet Jira Mobile

See how to use Jira on the go! Demo Den Episode 5 is here: meet Jira Mobile with  Jira  Product Manager Rayen Magpantay.  Demo Den is in our monthly series where a Jira PM demonstrates...

306 views 1 10
Join discussion

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