Jira Cloud - Create a project with shared settings from a template project with Rest API

It was a challenge to create a project in Jira cloud from a template project by using Rest API's. After doing some research , I found some hidden API's and here is a way how you can use those API's and can create the project.

By following below api's you can achieve following.

  • Create a project from existing project settings
  • Copy the board from existing board and associate with newly created project
  • Change the board name, filter, location for the board.





Create a project from template

This API will create a project with shared settings same as in existing project.

Request URL: https://yourinstance.atlassian.net/rest/simplified/latest/project/shared

Request Method: POST

{"name": "newproject name", "key": "newprojectkey", "existingProjectId":"10000"}


Copy the agile board

This api will copy the agile board , which you can associate later on with newly created project

Request URL: https://yourinstance.atlassian.net/rest/greenhopper/1.0/rapidview/<boardid>/copy

Request Method: PUT


Change the project location of the board

This api will change the board location which is the newly created project name

Request URL: https://yourinstance.atlassian.net/rest/greenhopper/1.0/rapidviewconfig/boardLocation

Request Method: PUT

{rapidViewId: boardid, locationType: "project", locationId: "destination project id"}


Create the Board Filter

This api will create the filter for the new board which you recently copied

Request URL: https://yourinstance.atlassian.net/rest/api/3/filter

Request Method: POST

{

  "jql": "filter query",

  "name": "filter name",

  "description": "filter description"

}


Change the board filter

This api will help you to change the filter which you created above for the copied board

Request URL: https://yourinstance.atlassian.net/rest/greenhopper/1.0/rapidviewconfig/filter

Request Method: PUT

{"id": boardid, "savedFilterId": "saved filter id"}


Rename the board name

This api will help you to rename the board name

Request URL: https://yourinstance.atlassian.net/rest/greenhopper/1.0/rapidviewconfig/name

Request Method: PUT

{"id": boardid, name: "new name"}


We are done here, Please feel free to add your remarks for any improvement.


About Author

Muhammad Ramzan  is Atlassian Certified Master & Consultant having 10+ years of professional experience in the area of DevOps, Software Testing(Manual/Automation) and Atlassian Tools Administration.

0 Comments