Jira Cloud Automation - 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.

My blog reference for the actual post: 

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 you

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.

 

My blog reference for original post: 

https://www.techclimbs.com/2021/05/jira-cloud-create-project-with-shared.html

2 comments

Andrey
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!
July 22, 2022

Thanks for this topic. But I would append some details to here:

There are not important things about boards`s owner that need to be replaced by /rest/api/3/filter/{filterId}/owner and then we need to send request for changing permission /rest/api/3/filter/{filterId}/permission

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.
March 14, 2023

Hi @Muhammad Ramzan(Atlassian Certified Master) 

Many thanks! How to check for other REST api endpoints that are not documented or publicly visible?

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events