How to create a project using REST API with Delegated Project Creator for Jira

This article helps you to create a project using the REST API with the Delegated Project Creator for Jira app.

Instructions

  1. Create a content.txt file as shown below:

    projectKey=BUSINESS&projectName=BusinessTeam&templateId=1&projectCategoryId=-10000&baseProject=-10200&projectLead=wittified
  2. Go to the command prompt in Windows or Terminal for Linux and run the following curl command. This curl command allows a trusted user to create a project from the specified template.

    curl -u automation:password -X POST -d @content.txt -H "Content-Type: application/x-www-form-urlencoded" -v http://your.jira.url/rest/projecttemplates/1.0/create-templates/create


    The parameters used in context.txt are:

    -- projectKey – The intended project key.

    -- projectName – The intended project name.
    -- templateId – The template ID to use.
    -- projectCategoryId – The project category ID to use.
    -- baseProject  – The project ID of the project you would like the settings to be copied from.
    -- projectLead  – The user to be made the project lead. If none passed, the current user is used.

    To get the respective values,

    -- baseProject : Go to the Project Settings --> Details. In the address bar, you see the "pid=". The number that follows is the PID.
    -- templateId : This article explains how to get the template id. It returns all available templates and template IDs upon running the query. 
    -- projectCategoryId : Go to Projects → View All Projects. Go to the respective project category column, and hover the mouse on the project category; for example: cot. At the bottom of the page, you can see the "selectedCategory=" in the address bar.

Make sure to update username, password, user_name, group _name and "http://your.jira.url" in the above curl commands as applicable.