Create new Project via REST based on existing Project

Michael Weilbuchner February 19, 2016

Hallo,

since it is now possible to create a new JIRA Project via REST (JRA-27256) and it is now (Version 7.1) possible to create a new Project based on an existing Project via the GUI, with all the Shemes of the existing Project.

I want to know if it is possible to use this Feature over REST? So create a new Project based on an existing Project over REST? If yes what do i give the REST API as projectTemplateKey to reference this existing Project?

Thanks

5 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

9 votes
Deleted user November 24, 2016

Hi,

As part of the creation process via the web interfaces, a undocumented REST API is called

POST /rest/project-templates/1.0/createshared/{0}

Where {0} is the numeric id of the project to clone.

A JSON body should be provided with the following information:

{
    "key": "THEKEY",
    "name": "The name of the new awesome project",
    "lead": "lead.username"
}

 

Works on JIRA 7.2.3

 

Hope that could help

Tekkie Admin July 27, 2017

Thank you! I am using this in my current project, and it's invaluable as a time saver.

Are there methods to find other undocumented APIs like this one?

Deleted user July 28, 2017

Yes, there is.

Best is to execute the action with the UI and see which services are called.

I did that by using the Dev tools available in Chrome.

 

Hope it helps.

Like Yatish Madhav likes this
Tekkie Admin August 2, 2017

Yes, it helps greatly!

Thanks for pointing out that their UI is using the same REST as the rest of us, now I can manually inspect what's going on and extract the undocumented calls that I'm needing.

NagaPavan Nalamati November 19, 2017

HI, thank you for the API call provided but when i use the code im not getting any error nor the project is not created 

the response state code is OK 

Any help would be appreciated 

My Problem statement

Create JIRA Project with shared configuration 

Create Crowd Group

Mapping Crowd groups to Jira Project with specific roles

 

Thanks 

John Gill May 30, 2019

Still works 8.2 Thanks for this, super helpful!

Please upvote this answer as it's the most correct for OP's question :) 

8 votes
George Dinkov _Botron_
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.
June 12, 2016

Hi Michael,

You can do this with Configuration Manager for JIRA. CMJ has a REST API and you can use it to create a snapshot on a project (or a set of projects) that will include all their related configuration objects. The snapshot can be then deployed on the current or any other JIRA.

If you have further questions or would like a demo drop us an email at sales@botronsoft.com. 

Cheers!

Wonderketchup June 13, 2016

Hi George,

is a cloud solution foreseen?

Thanks!

George Dinkov _Botron_
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.
June 13, 2016

Hi Tanguy,

Unfortunately not in the near future. In the long run probably yes.

John Gill May 30, 2019

A price point more than double  of Jira's base price point... **Spits drink out all over screen**

John Gill May 30, 2019

Correct and working answer below by François Karman. This works for 8.2 currently.  Please upvote below to remove a expensive marketplace item from top spot that does something we can already do via API call as OP requested. 

0 votes
prajakta.b.kulkarni January 27, 2019

Can anyone please suggest and Rest API for clone project ?

0 votes
francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 12, 2016

It looks like that the current REST Api is missing the necessary calls to set the workflow, field configuration, issue type screen and issue type scheme, unless your new project can be created from the default configuration, there will be some coding work required.

This can be done by implementing an add-on or create a script runner based end-point - check https://scriptrunner.adaptavist.com/latest/jira/rest-endpoints.html

The script runner has also implemented a built-in script to copy a project.  The jar contains the source code to get it all done.   I guess @Jamie Echlin [Adaptavist] might have some additional insights.

 

Francis

 

 

Anil Kumar January 27, 2019

Hi All,

I understand that the new projects CANNOT be created / cloned via REST in the CLOUD instances of Jira. Could you please let us know if this is still correct or CLOUD can now support the cloning / creation of new projects using REST Api based on the existing projects.

Like Eugene Yasiuchenko likes this
0 votes
Wonderketchup May 23, 2016

Hello @Michael Weilbuchner, I am also interested in an answer to your question!

Thanks

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events