Skip to content

Conversation

@dephekt
Copy link
Contributor

@dephekt dephekt commented Feb 25, 2021

There exists a private project-templates API endpoint for creating a new project based on an existing project: rest/project-templates/1.0/createshared. This PR adds support for this using a new Jira.create_project_from_shared_template() method.

This private interface has been described in the following discussions from which I derived this: [1], [2], [3], [4]

This PR would close #553. From that issue, we already support the public endpoint /rest/api/2/project for creating new projects from a raw JSON payload. Using that public interface, one can specify an existing workflow scheme to utilize for the new project. However, there's no way to specify extra settings like permission schemes, issue type schemes, etc. which is what this private endpoint allows and what some valid use cases require.

@dephekt
Copy link
Contributor Author

dephekt commented Feb 25, 2021

I am not able to test this functionality. If someone could please confirm whether this works or not I would appreciate it. It needs tested on:

Jira Cloud
Jira Server
Jira Datacenter

Specifically, I'm not sure if the value for the lead key should still be a username or an account ID. It's unclear if the GDPR changes of 2020 were applied to this private endpoint (since it is undocumented).

To test this module, you can install my version by doing:

pip3 install git+https://github.com/dephekt/atlassian-python-api.git@fix_issue_553

If you already had the module from pypa installed, you need to uninstall it first:

pip3 uninstall atlassian-python-api
pip3 install git+https://github.com/dephekt/atlassian-python-api.git@fix_issue_553

Then try to utilize the new method:

jira.create_project_from_shared_template("10000", "NPJ", "NEWPROJECT", "lead.username")

Where 10000 is the ID of the project you want to clone settings from, NPJ is the project key for the new project you are creating, NEWPROJECT is the name of the project and lead.username is the Jira username of the individual who should be assigned as the leader of the new project.

Report back with specific error messages and I'll make any necessary changes.

@dephekt dephekt marked this pull request as ready for review February 25, 2021 13:18
@gonchik
Copy link
Member

gonchik commented Feb 25, 2021

@VasiliyGrizel Could you double check on server and dc release please ?

@gonchik gonchik merged commit cc6c748 into atlassian-api:master Feb 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jira: Can't create Jira project

2 participants