Overview
Variables are placeholders for field default values that are fetched from the system when the issue is created. Variables are used to store information that is not known at the time the issue is created, such as the current user's name or the current date and time.
Variables can be used to configure default values. See more here.
Currently, variables are supported for the following fields:
Summary
Text field (single-line)
Description
Environment
Paragraph (multi-line text).
Single-user picker.
Multi-user picker.
Date fields.
System variables
Jira system variables are designed to encapsulate dynamic information throughout the instance. They are available across all templates and are generated automatically at the moment of issue creation.
Use case
Let’s take a look at a template with variables used by an HR team to automate team members data entry and improve workflow efficiency.
The template contains a description field with three system variables: $TODAY, $CURRENT_USER_NAME and $PROJECT_LEAD_NAME.
When the template is used, and a ‘Create issue’ dialogue is prompted, the correct values automatically replace the variable's placeholders.
Configuration
System variables are configured through the ‘Default values’ tab in the template configuration.
To insert a variable into an issue field, enter '/' into one of the supported fields. Start typing to find the required variables faster.
List of supported system variables
Variable | Description | Value Example | Supported in field types | Context |
---|---|---|---|---|
$CURRENT_USER_ACCOUNT_ID | Account ID of the currently logged-in user | 562658:342fc226-3c34 | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text) |
|
$CURRENT_USER_NAME | Name of the currently logged in user | Tom West | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text) |
|
$CURRENT_USER | Single-user picker | |||
$PROJECT_KEY | Key of the project | DEV | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text) |
|
$PROJECT_NAME | Name of the project | Development | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text) |
|
$PROJECT_LEAD_NAME | Name of the project lead | Tom West | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text) |
|
$PROJECT_LEAD_ACCOUNT_ID | Account ID of the lead of the project | 562658:342fc226-3c34 | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text) |
|
$TODAY | Current date | 16.09.22 | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text), Date picker |
|
$CURRENT_TIME | Current Time | 01:16 | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text) |
|
$TOMORROW | Tomorrow | 17.09.22 | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text), Date picker |
|
$NEXT_WEEK | Next week (current day + 7 days) | Today: Next week: | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text), Date picker |
|
$WEEK_OF_YEAR | Current week’s number | 37 | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text) |
|
$PARENT_KEY | Key of the parent issue | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text) | subtask templates only | |
$PARENT_SUMMARY | Summary of the parent issue | New feature request | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text) | subtask templates only |
$PARENT_ISSUETYPE | Issue type of the parent issue | Task | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text) | subtask templates only |
$PARENT_STATUS | Status of the parent issue | Done | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text) | subtask templates only |
$PARENT_PRIORITY | Priority of the parent issue | Medium | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text) | subtask templates only |
$PARENT_DUE_DATE | Due date of the parent issue | 2020-01-31 | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text) | subtask templates only |
$PARENT_CUSTOMFIELD | Value of any custom field of the parent issue. Pattern to use it : $PARENT_CUSTOMFIELD_ID | any value | Summary, Text field (single-line), Description, Environment, Paragraph (multi-line text) | subtask templates only |
NEXT_WEEK_START | If today is Wed , then NEXT_WEEK_START is Mon | Date picker | ||
NEXT_MONTH | If today is , then NEXT_MONTH is | Date picker | ||
NEXT_MONTH_START | If today is Wed , then NEXT_MONTH_START is Mon | Date picker | ||
NEXT_YEAR | If today is , then NEXT_MONTH is | Date picker | ||
NEXT_YEAR_START | If today is , then NEXT_MONTH is | Date picker |
Custom variables
Unlike system variables, custom variables are created by users and not generated automatically. They are most useful in use cases where the same value must be entered multiple times. Populating templates with custom placeholders allows users to minimise data entry to a single occasion, i.e., when creating an issue from the template.
Custom variables are configured per template.
Use case
Custom variables can be used to elevate an already existing onboarding use case.
For example, the new employee's name is used multiple times throughout the onboarding issue template, including sub-tasks. However, the name can not be retrieved via a system variable as it is not recorded anywhere in the instance. In this case, our app allows the creation of a custom variable - $EMPLOYEE_NAME. The variable placeholder is set as a default value in a required field. The HR team would like to have it in the summary & description fields of the new issue and a related sub-task:
When the template is used, before seeing a ‘Create issue’ dialogue, the user will see a variables form a dialogue with a list of all the custom variables configured for the template. During this step, the user is required to define the variables, and as a result, variable placeholders will be automatically replaced by the user's values.
In the next step, the user will see the familiar ‘Create issue’ screen with updated placeholders:
Configuration
To configure a custom variable, select a ‘Form variables’ tab in the template configuration. This tab lists all the variables configured for a specific template.
In the ‘Name’ field, enter the variable name. This is the name that users will see when in the form dialogue.
Click on the '+' icon to save the variable. The app will automatically generate a variable placeholder.