The official Atlassian tutorial on the subject of creating project template plugins is very shallow. It doesn't really explain how to use the "configure" function in the MyAddProjectHook class to associate all of the schemes to the new project. I've tried looking around through the 7.1.9 API docs and community Q&As, but the answers that I found weren't covering everything I need to do.
Here's what I have so far:
@Override
public ConfigureResponse configure(final ConfigureData configureData)
{
ConfigureResponse configureResponse = ConfigureResponse.create().setRedirect("/issues/");
IssueTypeSchemeManager issueTypeSchemeManager = ComponentAccessor.getIssueTypeSchemeManager();
WorkflowSchemeManager workflowSchemeManager = ComponentAccessor.getWorkflowSchemeManager();
IssueTypeScreenSchemeManager issueTypeScreenSchemeManager = ComponentAccessor.getIssueTypeScreenSchemeManager();
FieldConfigSchemeManager fieldConfigSchemeManager = ComponentAccessor.getFieldConfigSchemeManager();
Project project = configureData.project();
Scheme workflowScheme = workflowSchemeManager.getSchemeObject(Long.valueOf(10100)); //DEMO: My Project Template Workflow Scheme
IssueTypeScreenScheme issueTypeScreenScheme = issueTypeScreenSchemeManager.getIssueTypeScreenScheme(Long.valueOf(10000)); //Test Issue Type Screen Scheme
FieldConfigScheme fieldConfigScheme = fieldConfigSchemeManager.getFieldConfigScheme(Long.valueOf(10000)); //Test Field Config Scheme
workflowSchemeManager.removeSchemesFromProject(project);
workflowSchemeManager.addSchemeToProject(project, workflowScheme);
issueTypeScreenSchemeManager.addSchemeAssociation(project, issueTypeScreenScheme);
return configureResponse;
}
The workflow and issue type screen schemes apply fine, but I can't seem to find much info on the rest - Issue Type Scheme and Field Config Scheme.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.