I’m trying to create a project programmatically.
I found this:
But validation will fail, unless I supply everything:
ProjectCreationData data = new ProjectCreationData.Builder()
.withAssigneeType(Assignee Type as Long)
.withAvatarId(Avatar ID as Long)
.withDescription("Project Desc")
.withKey("Project Key")
.withLead("Username of lead")
.withName("Project Name")
.withType("Project Type Key")
.withUrl("Project URL")
.withProjectTemplateKey("Project Template Key")
.build();
The problem I have is with the project template. Validation will fail unless I provide an template, but if I provide the default template:
ProjectTemplateManager.getDefaultTemplate();
It will create default issue/workflow/screen schemes along with the project, and I don’t want that.
To create my own template, I found addProjectHook() in:
https://docs.atlassian.com/software/jira/docs/api/8.0.0/com/atlassian/jira/project/template/ProjectTemplate.html
Which in turn requires a ConfigureData class:
https://docs.atlassian.com/software/jira/docs/api/8.0.0/com/atlassian/jira/project/template/hook/ConfigureData.html
The static create() method seems to be what I want, but it requires a Project… before I create the project.
How to programmatically create a project along with the associated issue/workflow/screen schemes, or how to create a project with no schemes attached, then configure the schemes afterwards?