Skip to content

Commit cc6c748

Browse files
authored
[JIRA] Support private endpoint for creating new projects based on a template project (#730)
* Jira: Support creating project from shared template private endpoint. * Address Black formatting issue.
1 parent f9ba354 commit cc6c748

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

atlassian/jira.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,19 @@ def create_project_from_raw_json(self, json):
15251525
"""
15261526
return self.post("rest/api/2/project", json=json)
15271527

1528+
def create_project_from_shared_template(self, project_id, key, name, lead):
1529+
"""
1530+
Creates a new project based on an existing project.
1531+
:param str project_id: The numeric ID of the project to clone
1532+
:param str key: The KEY to use for the new project, e.g. KEY-10000
1533+
:param str name: The name of the new project
1534+
:param str lead: The username of the project lead
1535+
:return:
1536+
"""
1537+
json = {"key": key, "name": name, "lead": lead}
1538+
1539+
return self.post("rest/project-templates/1.0/createshared/{}".format(project_id), json=json)
1540+
15281541
def delete_project(self, key):
15291542
"""
15301543
DELETE /rest/api/2/project/<project_key>

0 commit comments

Comments
 (0)