Am I able to create a project via REST calls in Bamboo 6.2.2? Edited

I have tried PUT /rest/api/latest/deploy/project

but am getting back: "The plan you selected could not be found."

with a 400 response.

 

Nothing else appears suitable for project creation.

Am I missing something?

1 answer

0 vote
Gonchik Tsymzhitov Community Champion Oct 30, 2017

Hi! 

 

Could you clarify your question? 

What method have you used? (You should use PUT)

More info here https://docs.atlassian.com/bamboo/REST/6.2.2/#d2e927

It will be nice if show your response from server 

curl -s -u user:passwd -X PUT -H "Content-type: application/json" "http://bamboo.myinstance.com/rest/api/latest/deploy/project"

 

Then it will be possible to understand why you have seen error 400.

 

Cheers,

Gonchik Tsymzhitov

curl -s -u admin:admin -X PUT -d '{"name":"Test deployment 1","planKey":{"key":"PROJ-PLAN-1"},"description":"Project description 1"}' -H "Content-type: application/json" "http://localhost:8085/rest/api/latest/deploy/project"
{"errors":[],"fieldErrors":{"masterPlanKey":["The plan you selected could not be found."]}}

 

I've also tried omitting the planKey.

{"errors":[],"fieldErrors":{"masterPlanKey":["Please specify a Bamboo plan to pull deployment artifacts from."]}}

Is it not possible to create an empty project, and add plans afterwards?

You can use Bamboo Specs to create projects (or anything, really) remotely. https://confluence.atlassian.com/bamboo/bamboo-specs-reference-documentation-894743916.html 

Okay, so I can't create projects using the REST API, I need to use Bamboo Specs?

It looks like I can't queue build plans from Bamboo specs. Am I right in thinking I'll need to use the Bamboo specs to define projects, plans and jobs, and then use the REST API to trigger the plans?

Also, I'm curious to know if there are any future plans to add a project creation endpoint to the REST API. It would be very useful if we weren't tied to Java and could do all our automation through REST calls.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Renan Battaglin
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,489 views 0 5
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