How to create project via jira api Edited

Hi! I've a problem with creating jira project via REST API.

I have a jira version 6.3.8

I tried to use this instruction - https://confluence.atlassian.com/jirakb/creating-a-project-via-rest-based-on-jira-default-schemes-744325852.html

but i have this error - 405 Method not Allowed

How can i do this?

Thanks.

1 answer

1 accepted

4 votes

Before JIRA 6.2, newly created projects use the Default Issue Type Scheme. After JIRA 6.2 all new projects are created with a new Issue Type Scheme, Workflow and Screen Scheme. This requires a lot of task as the users have to change the assigned schemes and then delete the new ones. In order to avoid creating new issue type schemes, "JIRA Classic" or "Project Management" project type must be selected so that the Default Issue Type would then be used. 

  • $JIRAURL/rest/project-templates/1.0/templates as the Request URL
  • include the arguments below:
    • projectTemplateWebItemKey : com.atlassian.jira-legacy-project-templates:jira-blank-item
    • projectTemplateModuleKey : com.atlassian.jira-legacy-project-templates:jira-blank-item
    • name : project_name
    • key : PROJECTKEY
    • lead : project_lead
    • keyEdited: false

An example of working cURL command on JIRA 6.4.14:

curl -D- -u admin:sphere -X POST -H "X-Atlassian-Token: nocheck" -H "Content-Type: application/x-www-form-urlencoded" "http://localhost:61021/jira6414/rest/project-templates/1.0/templates?projectTemplateWebItemKey=com.atlassian.jira-legacy-project-templates%3Ajira-blank-item&projectTemplateModuleKey=com.atlassian.jira-legacy-project-templates%3Ajira-blank-item&name=SECOND+Create+from+REST+API&key=CFRAPI&lead=admin&keyEdited=false"

Friendly Regards,

Jeremy Mooiman

Oh, d*mn. I'm so stupid :)

Thank you!

Hello,

That's awesome Jeremy ! thanks

Do you know if it's possible to avoid using the default schemes when we use your method ?

I have some  already existing schemes in my 6.4.13 instance and would like to apply them directly of course

Thanks for your help

Rgds,

Will

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 Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

69 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