Hello, I am trying to retrieve a list of all the branches of build plan. My ultimate goal is to use this information to automatically create a release from each branch and then automatically deploy those branches.
I didn't get very far in this pursuit because the API method to list all branches of a build plan (https://docs.atlassian.com/atlassian-bamboo/REST/6.2.5/#d2e1475) only retrieves 25 results. Similar methods behave similarly.
Is there a way to retrieve a list of all branches, or otherwise try to accomplish what I want to do?
Thanks!
Hi @christok
The number of results is set by default to 25. You can change it by using the max-result property when calling the REST API endpoint as Alexey properly shared.
e.g.
curl -u admin:admin -X GET <BAMBOO_URL>/rest/api/latest/plan/<PLAN-KE
Y>/branch?max-result=1000
I see this property is missing in our docs for some of the endpoints including the one you mentioned. I've opened the following improvement request to cover this:
You are welcome!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this
curl -H "Accept: application/json" -u admin http://localhost:8085/rest/api/latest/plan/TEST-TEST/branch?max-result=1000
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @christok
If you remove the -H "Accept: application/json" part it will return the XML you want.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.