How to fetch all builds of a BAMBOO Plan from REST API?

I am trying to fetch all builds of a plan from Bamboo rest API. but its giving me only 25 builds.

API URLhttps://localhost:8085/rest/api/latest/result/PROJECTKEY-PLANKEY.json

As per the official documentation

The number of resources in returned lists is limited to 25, unless you specify max-result.

Hence for workaround, I thought I can fetch build size in first api call and pass size in second api call as max-results parameter. So that it will give me all builds for a plan. But first API call ( with max-results=1) giving me size 1 whereas same is working for fetching size of the projects.

API call to get the build size: (Not Working)

https://localhost:8085/rest/api/latest/result/PROJECTKEY-PLANKEY.json?max-results=1

output: size=1, max-result=1 (Whereas plan has 33 builds)

expected output: size=33, max-result=1

https://localhost:8085/rest/api/latest/result/PROJECTKEY-PLANKEY.json?max-results=PASS-SIZE-HERE

Working API to get the Project Size:

https://localhost:8085/rest/api/latest/project.json?max-results=1

output: size=30, max-result=1

My question here, Can we fetch all BUILDS of a PLAN? as by default its only fetching 25 builds.

4 answers

This widget could not be displayed.

Looks like a bug, created in issue https://jira.atlassian.com/browse/BAM-17961

This widget could not be displayed.

Thanks @Alexey Chystoprudov !

This widget could not be displayed.

can we get any solution on finding all builds data through rest api of bamboo as it only gives latest 25 build data.

or this is issue is as it is.

kindly reply ASAP.

 

This widget could not be displayed.

Just stumbled over this and identified the following workaround:

Workaround

Using an arbitrary large number (say 1,000,000) that is greater than the actual result set seems to return the actual '$results.size':

  • Get the size of the result set via 'max-results=1000000'
    https://localhost:8085/rest/api/latest/result/PROJECTKEY-PLANKEY.json?max-results=1000000

This returns the actual $results.size=x for me, allowing a proper request for the entire result set in turn.

 

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

78 views 1 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you