How to get a list of plans by project?

I have a web app deployment dashboard done in php/mysql that is currently using a table containing App names that relate to Projects and Plans in Bamboo, but is not integrated there. Thus, am getting bad data entered by folks manually when updating that dashboard with deployment information. I would like to either eliminate the need for the App list table by populating that page in my dashboard directly from Bamboo or keeping that table up-to-date with a similar call to Bamboo. I have successfully gotten 'some' data using the following, but it is not what I'm looking for exactly and is incomplete. Can anyone provide a more accurate REST API call that will provide me a list of Plans by Project from Bamboo?

Here's what I've tried with 'some' success so far...

...perl script...

# /rest/api/latest/project?expand=projects.project.plans
# my $cmd = "curl -H \"Content-Type: application/json\" -u $username:$pass";
# /rest/api/latest/project/KEY?expand=plans
# my $KEY="ERX";
# my $cmd = "curl -H \"Content-Type: application/json\" -u $username:$pass$KEY?expand=plans";

# above returns data but not exactly what I need.

# rest/api/1.0/search/plans?searchTerm=PROJECTNAME
# my $PROJECTNAME="eRx_Automation";
# my $cmd = "curl -H \"Content-Type: application/json\" -u $username:$pass$PROJECTNAME";

# above returns 404

system $cmd;

1 answer

0 vote

Hello Jesse,

Thank you for your question.

Could you please make sure you are running the REST API call against Bamboo, as it seems you are running it against JIRA based on the URL ( mentioned.

Please, notice you can loop through the projects and plans by using its iterator as per following:

# A, <projects expand="project" start-index="0" max-result="3" size="3"> where you can go from 0 to 2
# B, <plans expand="plan" start-index="0" max-result="17" size="17"> where you can go from 0 to 16

Please, refer to Bamboo REST API for further information.

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

Kind regards,
Rafael P. Sperafico
Atlassian Support

Thanks! I'll give that a try - I did realize before your answer that I should have been specifying bamboo not jira and that returned 'some' data - for instance, I've been able to get 500 of 629 plans, but can't seen to access those that would appear after clicking the show more plans button in bamboo. Hopefully, your suggestion will solve that problem for me. Thanks again.

my $cmd = "curl -H \"Content-Type: application/json\" -u $username:$pass[1].project.plans[1]"; system $cmd; curl: (3) [globbing] error: bad range specification after pos 77 what am I doing wrong - it gives that error no matter what values I put in brackets

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,782 views 0 6
Read article

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