How to create a project based on a project template

Deleted user September 22, 2020

I'm trying to use the jira API's to create a project with a custom project template for the "projectTemplateKey" key.

The only thing I have to go on is the following links.

https://community.atlassian.com/t5/Answers-Developer-Questions/Create-a-project-template-in-JIRA-and-use-this-project-template/qaq-p/468079 https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/project-createProject

// This is the only reference i've found to the jira project tempalte: https://docs.atlassian.com/software/jira/docs/api/7.0.7/com/atlassian/jira/project/template/ProjectTemplateManager.html

Using the following bit of code to create the project.

curl --request POST \
  --url 'https://{HOST}/rest/api/3/project' \
  --user '{EMAIL}:{API_KEY}' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "project-name",
  "description": "project-desc",
  "leadAccountId": "{LEAD_ACCOUNT_ID}",
  "url": "http://google.com",
  "projectTemplateKey": "{I_NEED_THIS-HOW_DO_I_GET_IT}",
  "assigneeType": "PROJECT_LEAD",
  "key": "LKEY",
  "projectTypeKey": "software"
}'

1 answer

0 votes
Fazila Ashraf
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2020

@[deleted]  , the list of available project template keys are in https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/#api-rest-api-3-project-post

 

Are you looking to create a new custom template? If yes, i don't think that is possible anymore.

You could however create projects with shared schemes of another project.

Deleted user September 22, 2020

Im trying to create a project with the API but with shared project template / scheme / issues etc. But in the project API, I cant seem to find a way to get a list of templates to provide to the "projectTemplateKey"param.

And I cant seem to find any reference anywhere to the identifier of the template from the interface

Fazila Ashraf
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2020

Like i mentioned in my answer, there is no custom projectTemplateKey at the moment.

You will have to use from the list available in https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/#api-rest-api-3-project-post

Screenshot from the above linkimage.png

 

From REST API, it is also not possible to create projects with shared configuration from another project. Refer to the below open request for the same

https://jira.atlassian.com/browse/JRASERVER-45929

David Bakkers
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.
September 22, 2020

This question comes up from time to time. The REST API is currently unable to lookup and return a list of projectTemplateKeys, you have to manually provide the value.

Read this article to know what the values for the projectTemplateKey can be.

Vote on this issue if you think getting the projectTemplateKey is something that should be added to the REST API.

David Bakkers
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.
September 22, 2020

And also this issue looks like a duplicate to vote on adding this to the REST API for Jira Server:

https://jira.atlassian.com/browse/JRASERVER-66918

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events