Issue Templates for Jira

Jira Server
HOSTING
Last updated Oct 26, 2018

Variables

Dynamic Variables

Dynamic variables are placeholders in a template, which are filled with any value that is typed into the placeholder defined field when a user creates a new issue or appy template.

Configuring Dynamic Variables

Configuration is located under the project settings.

Steps

To configure Dynamic Variables:

  1. Go to the Jira Administration and select Add-ons.
  2. Click Configuration on the left sidebar.
  3. Choose Variables from Issue Templates Configuration list.
  4. Settings of variables displays:
    a. Start pattern: Type pattern which opens variable.
    b. End pattern: Type pattern which closes variable.
    c. Mandatory mark: Type mark which user should add after end pattern to make variable required.
    d. Don’t replace empty option: Select to not replace empty values of variables.
    e. Auto Replace Variables: Select to automatically replace variables, without Replace All button.
Note

You can change patterns and mark, but you can also keep default ones. To edit patterns, click on pencil icon.

Tip

Variables can be formatted. For example: by surrounding the variable with the color tags {color:red} [name] {color}. For more information on text formatting, see official Atlassian documentation.

Types of Dynamic Variables:

  • Text field

To create a text field with the specific name, set up a variable name in brackets. For example: [version]. To make a variable required, add an asterix (*) at the end of the variable definition. For example: [version]*.

Note

An asterix (mandatory mark) is set by default. It can be changed in the variables configuration.

  • Single select

To create a single selection with variables, set up a specific pattern after the variable name using the (|) as a separator. For example: [City|Warsaw|London|Berlin].

To make a variable required, add an asterix (*) at the end of the variable definition.
For example: [City|Warsaw|London|Berlin]*.

  • Multi select

To create a multi selection with variables, set up a specific pattern after the variable name using the (|) as a separator and start (*) after a variable name. For example: [City * |Warsaw|London|Berlin].

To make a variable required, add an asterix (*) at the end of the variable definition.
For example: [City * |Warsaw|London|Berlin]*.

Creating Issue using dynamic variables

Steps

To create template using Dynamic Variables:

  1. Click on Create on the global sidebar to create new template.
  2. On the Create issue dialog box configure the following:
    a. Project: Select your Templates Repository Project.
    b. Issue Type: Select the relevant issue type.
    c. Summary: Write a summary using Dynamic Variables.
    d. Description: Write a description using Dynamic Variables.

  3. Click Create.

    Note

    Make sure that your text fields (for example summary, description) are in Set of fields of Autocomplete in target template.


  4. Click Create on the global sidebar. On the Create issue dialog box configure the following:
    a. Project: Select the relevant project.
    b. Issue Type: Select the relevant issue type.
    c. Template: Select the relevant template (with Dynamic variables).

  5. Complete Dynamic Variable placeholders and click Replace all.

  6. Click Create.

Result

Issue with Dynamic Variables is created.

Static Variables

Static Variables allow to create templates that contain static information, which is evaluated into actual values when you use the template to create an issue. Unlike dynamic variables, users can’t modify static variables while creating or applying a template because the values for static variables are supplied by the system.

Example

When you choose template that contains autocomplete values, static variables will refer to the appropriate values. Markup for Static Variable begins with the $ sign (you can change this in app’s configuration using Change prefix button). To use static variables you have to place the markup for them in the template text field or template sub-task where you want the resolved value to appear.

Adding a new Static Variable

In addition to the standard Static Variables, the Jira administrator can add a new Static Variable with a constant value.

Steps

To add a new Static Variable:

  1. Go to the Jira Administration and select Add-ons.
  2. Click Configuration on the left sidebar.
  3. Choose Variables from Issue Templates Configuration list.


4. Click on Static Variables. The list of static variables appears.
5. Click on Add own variable.
6. Type the name of variable and its description.
Tip

Do not use the $ sign here, it will be added automatically after creating the Variable. Add description for your variable, which is a value that will replace the custom variable.


7. Click Add.

Result

New Static Variable is added to the Custom variables list.

Predefined Static Variables

In Issue Templates there is a set of Predefined Static Variables. Those variables can be used in issues and sub-task or only in sub-task.

Static variables in issues and subtasks

Name Description
$ISSUE KEY The key of current issue.
$USER_KEY Key of user who creates issue
$USER_NAME Full name of user who creates issue
$USER_MAIL Address email of user who creates issue
$CURRENT_USER_KEY Key of current user
$CURRENT_USER_NAME Full name of current user
$CURRENT_USER_MAIL Address email of current user
$PROJECT_KEY Key of project
$PROJECT_NAME Name of project
$PROJECT_LEAD Full name of lead of project
$TODAY Current date e.g. 10.02.14
$CURRENT_TIME Current Time e.g. 12:53
$TOMORROW Tomorrow e.g. 11.02.14
$NEXT_WEEK Next week e.g. 17.02.14
$CUSTOMFIELD_10000 Custom field value. Replace ‘10000’ with your custom field ID

Static variables in subtasks

Name Description
$PARENT_KEY Key of parent issue
$PARENT_SUMMARY Summary of parent issue
$PARENT_DESCRIPTION Description of parent issue
$PARENT_ISSUETYPE Issue type of parent issue
$PARENT_STATUS Status of parent issue
$PARENT_PRIORITY Priority of parent issue
$PARENT_DUE_DATE Due date of parrent issue
$PARENT_CUSTOMFIELD_10000 Custom field value. Replace ‘10000’ with your custom field ID

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.