This chapter describes the Basic dynamic variables syntax and available field types.
Basic dynamic variables are placeholders you type directly into template text fields (for example, summary or description) using a bracket syntax. No configuration screen is needed. When a user creates a work item from the template, a form is displayed where they fill in values for each variable.
Try live demo:
For example, you can configure a template like this:
Dynamic variables used above:
Employee name: [Employee name]*
Starts on: [Start date:date]*
Position: [Position | Developer | Writer | UX | Tester | Product owner]*
Manager: [Manager:user]
Equipment required: [Equipment* | laptop | monitor | monitor x2 | headset ]
Prepare:
[Prepare:paragraph]
To configure the format of your dynamic placeholders:
"City {{ cityVariable }} is optional" becomes "City is optional").
It’s sufficient to define a variable only once in any field. It can then be referenced by name alone anywhere else in the template. The order doesn’t matter.
Description:
Equipment for a new employee [equipment*| laptop| monitor| headset]*
Summary:
An order of equipment for a new employee: [equipment]
You can change the order of dynamic variables displayed to the end user with drag and drop during the configuration process:
If you define dynamic variables in an epic and use the same variable in a story/subtask, all placeholders are replaced with the provided value. However, variables defined only in stories or subtasks aren’t taken into account.
There are multiple field types supported by Basic dynamic variables. Using correct formatting, you can define:
Add * at the end of the placeholder to make a field required.
Add * inside the brackets to allow selecting more than one option (multi-select instead of single-select).
Use the | mark as a separator to create select options. For example: [City|Warsaw|London|Berlin].
The following examples assume you are using brackets [] as the start and end pattern and * as the required mark. You can change these - see Dynamic Variables Format for details.
| Placeholder | Field type | Field name | Field options | Required |
|---|---|---|---|---|
[Version] |
Text field | Version | - | false |
[Version required]* |
Text field | Version Required | - | true |
[City|Warsaw|London|Berlin] |
Single select | City | Warsaw, London, Berlin | false |
[City Required|Warsaw|London|Berlin]* |
Single select | City Required | Warsaw, London, Berlin | true |
[City Multi-select*|Warsaw|London|Berlin] |
Multi select | City Multi-select | Warsaw, London, Berlin | false |
[City Multi-select Required*|Warsaw|London|Berlin]* |
Multi select | City Multi-select Required | Warsaw, London, Berlin | true |
[Definition of Done:paragraph] |
Text field (multi-line) | Definition of Done | - | false |
[Launch date:date] |
Date picker | Launch date | - | false |
[Meeting time:datetime] |
Date time picker | Meeting time | - | false |
[Manager:user] |
User picker | Manager | Returns users matching the query | false |
[Story points:number] |
Number field | Story points | - | false |
You can also use the following built-in variable types by keyword:
| Field | Value |
|---|---|
| ASSIGNEE | assignee |
| COMPONENTS | components |
| DATE | date |
| DATE_TIME | datetime |
| DESCRIPTION | description |
| DUE_DATE | duedate |
| FIX_VERSIONS | fixVersions |
| ISSUE | issue |
| LABELS | labels |
| MULTISELECT | multiselect |
| NUMBER | number |
| PARAGRAPH | paragraph |
| PRIORITY | priority |
| SELECT | select |
| SPRINT | sprint |
| STRING | string |
| TEAM | team |
| USER | user |
| USERS | users |
For the user picker, you need the browse users permission to search by user attributes such as displayName and emailAddress. Otherwise, type an exact username.
See the Atlassian developer website for more details.
You can define a dynamic variable using a Jira field key. A variable defined this way has the same name and options as the field on the work item create screen of the target space.
You can optionally name a variable - otherwise it takes the name of the Jira field.
You can find all field keys at https://{yourjira}.atlassian.net/rest/api/2/field.
Components=[:components]
Fix versions=[:fixVersions]
Priority=[:priority]
Checkboxes=[:customfield_11602]
Labels=[:labels]
Assignee=[:assignee]
Due date=[:duedate]
Date Picker=[:customfield_11692]
Date Time Picker=[:customfield_11620]
Description:[:description]
Text Field (multi-line)=[My custom name:customfield_11606]
Issue picker=[variable-name:issue]
You can create Jira fields with a [:customfield_Id] placeholder. Such a placeholder is converted into a variable of the same type as the field. The field needs to be visible.
This variable isn’t generated on the Create from template screen if a field:
You can use the issue picker dynamic variable ([variable-name:issue]) to select a work item as a dynamic variable and insert information from other tasks into your templates automatically.
Most common fields are supported, including system and custom fields.
If a field type matches a supported dynamic variable type, it’s displayed using a dedicated component - for example, the Due date field (:duedate) is displayed as a Date Picker. Otherwise, it’s displayed as a simple text field.
Use Smart defaults with a variable accessor referencing the variable name or the Jira field name if no custom name was given.
| Variable defined as | Use |
|---|---|
[Release versions:fixVersions] |
variable("Release versions") |
[:duedate] |
variable("Due date") |
Dynamic variables are supported while creating work items via the issue.templates.automation property. See the Automation chapter for details.