Apps documentation
Issue Templates for Jira
Server/Data Center Cloud
Issue Templates for Jira

Server/Data Center

Cloud

8.x
7.x
FAQ
Release notes
Last updated Sep 17, 2020

Create Structure Post Function

Learn how to apply templates using the Create Structure post function.

Create Structure allows you to add additional values from a template to your issue. You can create new tasks or construct a complex structure of issues based on a template. All that is possible while creating a new issue or performing any other issue transition within its workflow.

It combines all the possibilities of older post functions: Create issue, Copy Sub-tasks, Copy from Epic and Copy Values.

What’s new is that Create Structure allows you to copy the exact hierarchy of linked issues during workflow transition:

  • create sub-tasks
  • create stories under an epic
  • create other linked issue
  • copy any Jira field or custom field value (read more about Supported fields here).

Examples of use are recurring events or a new employee’s onboarding that require creating almost the same bunch of issues every time.

Advanced use:

  • creating additional sub-tasks when performing different transitions on the issue (“staging” the sub-task)
  • creating an additional issue (or more complex structure of issues) in another project during the Create Issue transition or any other workflow transition.
  • apply additional values from the template for the created issue (available soon)

Add post function

This section introduces the basic steps of applying a template.

First of all, you’ll need to add our post function to your project’s workflow. Here is a short guide with all the basic steps. Different ways of applying templates will be described in the next sections.

Steps

  1. Go to Project Settings > Workflows.
  2. Select the workflow and go to Diagram > Edit.
  3. Click on the transition of your choice (in most cases: Create) and go to Post Functions.
  4. Click Add Post Function and select Deviniti [Issue Templates] - Create Structure.
  5. Remember to Publish the changes.
  6. Go to Project Settings > Screens and select your project’s Default Issue Screen.
  7. Add the Template field.
  8. Create a new issue.
  9. Select an Issue Type.
  10. Select the Template from the drop-down list.
  11. Fill in other fields and click Create.

Result

The template will be applied to the newly created issue.

Info

This post function works on other transitions, too. Read on to see how you can create new issues and apply templates on further workflow transitions.

Tip

Make sure that the Create Structure post function is listed under the step Creates issue originally and before Re-index an issue to keep indexes in sync with the database. Otherwise it might not work.

Issue Templates for Jira - Create Structure: Add Post Function
Issue Templates for Jira - Create Structure: Add Post Function
Note

Create Structure will always create the entire structure of issues and override the availability settings of the particular issues. Example: If a story is set as unavailable it only means that it won’t be selectable within the Template field. However, when it’s parent epic gets created using the post function, the story will be created as well.

Modify current issue

This section explains how to apply a template to an existing issue.

To apply a template you can either add it to the Create Issue screen of your issue or you can set it up directly on the Add Parameters To Function panel. In both cases you’ll need to prepare your structure of templates beforehand. So, if you need an epic with stories and sub-tasks, just create that model structure within the Template Repository project (TEMP). Give it a recognizable template name, in order to find it easily back at this point.

Note
Please remember that using templates requires some initial configuration. Read our use case to see how it works in a real life example.

Steps

To apply the structure of issues you’ve prepared for your project:

  1. Add the post function Create Structure to the first workflow transition (Create).
  2. Select Modify current issue as the Operation mode.
  3. Select the proper template from the drop-down list under Template.
  4. Leave the default value for Sub-task stage as none.
Issue Templates for Jira - Create Structure: Modify Current Issue
Issue Templates for Jira - Create Structure: Modify Current Issue

Result

The template is applied to the current issue. For example, if your template is an epic with stories and sub-tasks, then while creating that epic, the stories and sub-tasks will get created automatically. All the values you’ve filled in in your template will be copied into the right fields, too.

Create new Issue

This section explains how to create an issue and apply templates in another project.

In some cases it is convenient to create an issue that triggers a specific process in a different project (often handled by a different team). For example, an epic organizing new members onboarding within an HR team can create another epic - for the IT department, to prepare all necessary equipment for the new employee.

Steps

To create an issue that creates another set of issues:

  1. Add the post function Create Structure to the first workflow transition (Create).
  2. Select Create new issue as the Operation mode.
  3. Select the proper template from the drop-down list under Template.
  4. Select the target project, where the template should be applied.
  5. Go to Issue linking and choose how your current issue should be linked with the one being created in a different project.
Issue Templates for Jira - Create Structure: Create New Issue
Issue Templates for Jira - Create Structure: Create New Issue
Tip

It is a good idea to link your current issue with the one being created from template. This way you’ll be able to find it easily afterwards and make the issue relationship visible to everyone.

Result

When the current issue gets created, another issue or a set of linked issues is created from the selected template.

Create sub-task during transition

This section explains how to set up a sub-task to be created later in the workflow.

You might want to create a sub-task only after certain steps are completed in your project’s workflow. For example, granting application access to new employees only makes sense after they accepted the job and signed their contract. Follow these steps to create such additional, “delayed” sub-tasks:

Steps

First you need to configure the sub-task that will be used in the post function:

  1. Create a sub-task in your template project. It can be listed under the same story, as the regular sub-tasks that get created on the “Create” transition.
  2. Open the newly created sub-task and go to Issue Templates Details > Create conditions.
  3. In the “Stages” field, type in a description of your choice - one that will be easy to find later.
  4. Click on the new description to save it.
  5. Click the checkbox to confirm the operation.
Issue Templates for Jira - Create Structure: Create Sub-task During Transition
Issue Templates for Jira - Create Structure: Create Sub-task During Transition

Steps

To use the “staged” sub-task in your workflow:

  1. Add the post function Create Structure to the workflow transition upon which the sub-task should be created.
  2. Select Create new issue as the Operation mode.
  3. Under Template, select the template that contains your sub-task.
  4. Select the target project, where the new sub-task should be created.
  5. Go to Issue linking and choose how your current issue should be linked with the sub-tasks.
  6. Select the Sub-task stage of your sub-task from the drop-down menu.
Issue Templates for Jira - Create Structure: Create Sub-task During Transition
Issue Templates for Jira - Create Structure: Create Sub-task During Transition

Result

The sub-task is now “programmed” to get created, after your current issue changes its status and arrives at the chosen transition.

Execute the post function asynchronously

At the bottom of the post function configuration screen there is a checkbox that allows you to make the issue creation process more efficient. It is particularly useful when your template has many sub-tasks or linked issues: if you were to create them all at once, you’d risk a Jira session timeout.

If you execute the post function asynchronously, the linked issues will be created one by one in the background.

Issue Templates for Jira - Create Structure: Execute the post function asynchronously
Issue Templates for Jira - Create Structure: Execute the post function asynchronously
Note

You will get a notification only after the first issue creation. All other tasks will be created without any notification, but you can always check the progress in the Event log.

Need help?

If you can’t find the answer you need in our documentation, raise a support request*.

*Include as much information as possible to help our support team resolve your issue faster.