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,552,675
Community Members
 
Community Events
184
Community Groups

How to create project with shared Configuration via REST API

Edited

Hi!

We need create JIRA projects via API, but we don't want create new schemes to each project created, we want create project using existing schemes.

We need to do via API the same happens when we use the option "Create With Shared Configuration" in create project screen.

Is that possible?

2 answers

10 votes
Alex Gallien
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 14, 2017 • edited

Hi Sergio, I was looking for this too, and came across a solution on https://jira.atlassian.com/browse/JRASERVER-27256. As Andry said there, you can use the endpoint:

/rest/project-templates/1.0/createshared/{projectId} 

with the JSON:

{"key":"NEWPRJ","name":"Test Project created with shared configuration with TMPLPRJ","lead":"user1"}

where {projectId} is the ID of the project whose configuration you are using. Since this is not documented it is not a formally supported endpoint, but it worked for me. Hope that helps!

Hello Alex, I've been trying to use this endpoint but without success, can you confirm that it still works?

Sana Safai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Apr 24, 2018

Hi Lucas, 

Are you trying with the project key instead of the project ID in the endpoint?

The project key is what precedes the ticket number (such as JRASERVER in the above post) whereas the project ID is what you see when you try to delete a project and observe the five-digit number after pid= in the url.

Hello. I've been trying to use this endpoint as specified above on JIRA 7.3.6, using the ID number (not the project key) of properly configured project in the endpoint, and I've consistently received code 500 errors in the response, with a PostgreSQL exception complaining that the key I gave for the new project already exists:

Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "idx_project_key"
  Detail: Key (pkey)=(DDTPA) already exists.

This seems to occur no matter what key I use, and examining the JIRA instance afterwards, I can confirm that it did actually create a new project with that key, with the name and project lead I specified. Any tips on getting the correct response from this endpoint?

Alright, so I take back my earlier comment insofar as this actually works just fine from curl (response code 200). It's Ansible's uri module that's getting the response with an SQL error, so now I'm focusing on getting Ansible to behave in the same way.

0 votes
josh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 04, 2017

Hello Sergio,

I want the same, but this isn't possible today with the REST API. The only way I am aware of to do this programatically is with the Jira CLI addon https://bobswift.atlassian.net/wiki/spaces/JCLI/pages/266178329/Actions#Actions-createProject

Alex Gallien
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 14, 2017

Hey Josh, if you're still looking for this I figured out a way to do it from the comments on  https://jira.atlassian.com/browse/JRASERVER-27256. See my other response below for more details!

josh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 19, 2017

Cool - I was only aware of the POST /rest/api/2/project endpoint which doesn't allow setting workflow scheme etc.

Time to automate :)

Thanks!

Hi , I was trying to do the same with JIRA API CLoud but i couldn't.

Do you find a way to do it?

Regards.

Pablo.

Like Eugene Yasiuchenko likes this
Artur Faruga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 17, 2019
Atlassian Update – 17 December 2019

Hi everyone,

We've added a new project REST API option to Jira Software Server and Data Center. Starting from Jira 8.6 you will be able to fully automate creating new projects with specific workflowSchemes. We have extended Jira REST API and added a new endpoint and a new parameter:

  • POST /rest/api/2/project 
    • with a new optional workflowSchemeId field to create a project and assign a workflowScheme
  • GET /rest/api/2/project/{projectKeyOrId}/workflowscheme
    • get info about workflowScheme configured for a project

 

It’s worth adding that in Jira 8.0 we’ve also added "IssueTypeSchemes" API.

Artur Faruga
Kind regards,
Jira Server Developer

Like # people like this

Are these features also available for the Jira cloud software via REST API call?

It is working for Server, but for cloud not working properly. Project is created with internal server error. Also created project is not getting opened even from jira cloud UI.

/rest/project-templates/1.0/createshared/{projectId} 

with the JSON:

{"key":"NEWPRJ","name":"Test Project created with shared configuration with TMPLPRJ","lead":"user1"}

Above worked for me in Jira 8.5.6 DC 

Like Jnr likes this

Hi @manoj reddy gajjala ,

 

Do you think we can create using project KEy?

 

Regards,

Sunil

Yasen Terziivanov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Mar 21, 2023

We've been using this endpoint for a while, but today we noticed that it just returns 400 Bad request, without any additional information. Does anyone know if something changed?

Tenzin Kalsang
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Mar 29, 2023

Nothing has changed on my end. I can still run this endpoint. 

Suggest an answer

Log in or Sign up to answer