Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Create dynamic project template for Jira

Pete75 April 26, 2018

Hi,

I'm trying to clean-up the mess with every project in Jira having the own WorkFlowSchemes etc. Then I tried to create own project-blueprint plugin which uses certain WorkFlowScheme and IssueTypeScheme etc.. so I got the basic things working. But I would like to add soy template there where I can select for example which workflowScheme and issueTypeScheme I use for that project..

I have the following kind of soy file:

{template .page1Form}
<p>{getText('my.project.template.info.page.description')}</p>
<form action="#" method="post" class="aui">
<fieldset>
<div class="field-group">
<label for="template-key">{getText('my.project.template.info.page.description2')}</label>
<select id="template-key" class="select" name="contentTemplateKey">
<option value="simplebp-template">{getText('my.project.template.workflow.scheme.name')}</option>
<option value="simplebp-template2">{getText('my.project.template.workflow.scheme.name2')}</option>
<option value="simplebp-template3">{getText('my.project.template.workflow.scheme.name3')}</option>
</select>
</div>
</fieldset>
</form>
{/template}

Then I have following kind of atlassian-plugin.xml


 <atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2">
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}" />
<param name="plugin-icon">images/pluginIcon.png</param>
<param name="plugin-logo">images/pluginLogo.png</param>
</plugin-info>

<!-- add our i18n resource -->
<resource type="i18n" name="i18n" location="my-project-template"/>

<!-- add our web resources -->
<web-resource key="my-project-template-resources" name="my-project-template Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>

<transformation extension="soy">
<transformer key="soyTransformer"/>
</transformation>

<resource type="download" name="myProjectTemplate.soy.js" location="/soy/myProjectTemplate.soy"/>

<resource type="download" name="images/" location="/images">
<param name="content-type" value="image/png; charset=binary"/>
</resource>

<context>atl.general</context>
<context>atl.admin</context>
</web-resource>

<project-blueprint key="my-project-template" weight="90">
<label key="my.project.template.name"/>
<description key="my.project.template.description"/>
<longDescription key="my.project.template.description.long"/>

<!-- <infoPage soy-template="JIRA.Templates.ProjectTemplates.Tutorial.renderMyProjectTemplateExplanation" /> -->
<infoPage soy-template="JIRA.Templates.ProjectTemplates.Tutorial.page1Form" />

<icon location="images/my-template-icon.png"/>
<backgroundIcon location="images/my-template-background.png"/>

<add-project>
<hook class="com.example.plugins.tutorial.MyAddProjectHook"/>
<descriptor file="/config/my-project-template-config.json"/>
</add-project>

</project-blueprint>

</atlassian-plugin>

 

When I create the new Project in Jira I get the selection "info" window there but how can I link the selection to my Java code - MyAddProjectHook or can I do it somehow in xml?? I'm a bit lost here.... I have in soy template selections: simplebp-template,simplebp-template2,simplebp-template3 but how I "reflect" the selection further to my "wizard"? Did you got the point :)

Thanks

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events