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

Cloud

Server/Data Center

Documentation
FAQ
Release notes
Articles & Videos
Last updated Sep 20, 2021

Static variables

This chapter provides information about static variables.

Static variables are placeholders that are filled with actual values supplied by the system. Each variable refers specific value of the Jira instance while the issue is being created.

In Issue Templates for Jira app, predefined Static variables will be evaluated when an issue is created from a template. You can use Static variables in all text fields, for example: Summary, Description, Environment.

Note
Before you start configuring Static variables, make sure you have a Project administrator permission.
Issue Templates for Jira Cloud: Static Variables
Static Variables

List of predefined variables

Variable Evaluated to Evaluation example
$ISSUE_KEY The key of the current issue DEV-1
$SUMMARY Can be used to keep the original summary while applying a template Original summary: $SUMMARY
$DESCRIPTION Can be used to keep the original description while applying a template Original description: $DESCRIPTION
$ENVIRONMENT Can be used to keep the original environment while applying a template Original environment: $ENVIRONMENT
$USER_KEY Deprecated - Account ID of the user who created the issue 562658:342fc226-3c34
$USER_ACCOUNT_ID Account ID of the user who created the issue. 562658:342fc226-3c34
$USER_NAME Display the name of the user who created the issue. Tom West
$USER_MAIL Address email of the user who created the issue. tom.west@domain.com
$CUSTOMFIELD_00000 String representation of value of given custom field in the current issue. Replace 00000 with correct custom field ID any value
$CURRENT_USER_KEY Deprecated - Account ID of the currently logged in user 562658:342fc226-3c34
$CURRENT_USER_ACCOUNT_ID Account ID of the currently logged in user. 562658:342fc226-3c34
$CURRENT_USER_NAME Display name of the currently logged in user. tom.west@domain.com
$CURRENT_USER_MAIL Email address of the currently logged in user. Result depends on https://id.atlassian.com/manage-profile/profile-and-visibility settings. tom.west@domain.com (restricted)
$PROJECT_KEY The key of the project DEV
$PROJECT_NAME The name of the project Development
$PROJECT_LEAD Deprecated - Display name of the lead of the project Tom West
$PROJECT_LEAD_NAME Display the name of the lead of the project Tom West
$PROJECT_LEAD_ACCOUNT_ID Account ID of the lead of the project 562658:342fc226-3c34
$TODAY Current date 10.09.21
$CURRENT_TIME Current Time 09:25
$TOMORROW Tomorrow 11.09.21
$NEXT_WEEK Next week 16.09.21
$WEEK_OF_YEAR Current week number 47
$PARENT_KEY The key of the parent issue. DEV-2
$PARENT_SUMMARY Summary of the parent issue New feature request
$PARENT_DESCRIPTION Description of the parent issue New feature description
$PARENT_ISSUETYPE Issue type name of the parent issue Task
$PARENT_STATUS Status name of the parent issue To do
$PARENT_PRIORITY Priority name of the parent issue Medium
$PARENT_DUE_DATE Due date of the parent issue 2020-01-31
$PARENT_CUSTOMFIELD String representation of value of given custom field in the parent issue. Replace 00000 with correct custom field ID. any value
$PRIMARY_ISSUE_SUMMARY Summary of the primary issue from which the templating process started. Summary of the root issue, provided in the Create issue dialog.
$PRIMARY_ISSUE_DESCRIPTION Description of the primary issue from which the templating process started. Description of the root issue, provided in the Create issue dialog.

Add your own static variable

You can add your own static variables to existing ones. New variable will be replaced by provided static string.

To add a new static variable:

  1. Navigate to the Templates repository > Project settings > Issue Templates > Variables.
  2. Select Static type of variable.
  3. In Custom variables section, click Add.
  4. Type the Name, and the Value into text fields.
    Note
    Do not use the prefix sign here. It will be added automatically right after creating the Variable.
  5. Click Add.
    Issue Templates for Jira Cloud: Static Variables
    Static Variables

Result

New variable has been added.

Issue Templates for Jira Cloud: Static Variables
Static Variables

Change the prefix

By default, Static variables are prefixed with $.

To change this setting:

  1. Navigate to the Templates repository > Project settings > Issue Templates > Variables.
  2. Select Static type of variable.
  3. In Custom variables section, click Change prefix.
  4. Change the prefix.
  5. Click Save.
    Issue Templates for Jira Cloud: Static Variables
    Static Variables

Result

The prefix has been changed.

Keep original input after applying a template

Using variables allows you to apply a template on an already-existing issue and keep input provided by users.

All text fields are supported:

  • Description $DESCRIPTION
  • Summary $SUMMARY
  • Environment $ENVIRONMENT
  • Custom fields $CUSTOMFIELD_## (## - is an ID of a custom field)
    Tip

    You can find the ID in the URL of a configuration of a custom field. See Atlassian support for details.

Note
The original value will be kept only if a variable is used in the corresponding field, for example, $DESCRIPTION used in the Description field. Otherwise, value from the template will be used.

Steps

  1. Add variables to your template in your repository project.

    Issue Templates for Jira Cloud: Static Variables
    Static Variables

  2. Go to the issue you want to apply the template on.

    Issue Templates for Jira Cloud: Static Variables
    Static Variables

  3. Apply the template on the issue.

    Issue Templates for Jira Cloud: Static Variables
    Static Variables

    Info

    See Apply template for details.

Result

The template is applied keeping original user input.

Issue Templates for Jira Cloud: Static Variables
Static Variables