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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,459,328
Community Members
 
Community Events
176
Community Groups

Bamboo API only displaying 25 branches of build plan

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!

2 answers

2 accepted

1 vote
Answer accepted

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:

Like Daniel Santos likes this

You are welcome!

0 votes
Answer accepted

Try this

curl -H "Accept: application/json" -u admin http://localhost:8085/rest/api/latest/plan/TEST-TEST/branch?max-result=1000

That worked, thanks! The one comment I'd make is that this particular method seems to return JSON not XML.

Hi @christok

If you remove the -H "Accept: application/json" part it will return the XML you want.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events