- Get started
- About
- Quick guide
- Use cases
- Glossary
- Migration
- Configuration
- Global configuration
- Project configuration
- Repository
- Template configuration
- Template scope
- Manage templates
- Supported fields
- Permissions
- Using templates
- Create issue from template
- Create issue structures
- Apply template to existing issue
- Recreate issue
- Use template custom field on issue create screen
- Default templates
- Direct link
- JQL searchers
- Variables
- Static variables
- Dynamic variables
- App Integrations
- Team-managed projects
- Jira Software
- Jira Service Management
- Advanced Roadmaps
- Issue Checklist for Jira
- Advanced
- Automation
- Legacy automation action
- REST API
- Create issue and apply template with Jira REST API
- Security
- Security statement
- App permissions
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 a specific value of the Jira instance while the issue is being created.
In Issue Templates for Jira, predefined Static variables are evaluated when an issue is created from a template. You can use Static variables in all text fields, for example: Summary, Description, Environment.
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. A new variable is replaced by a provided static string.
To add a new static variable:
- Navigate to Apps > Manage your Apps > Issue Templates for Jira > Configuration > Variables.
- Select a Static type of a variable.
- In the custom variables section, click Add.
- Type the Name, and the Value into text fields.
NoteDon’t use the prefix sign here. It will be added automatically right after creating a variable.
- Click Add.
Result
A new variable has been added.
Change the prefix
By default, Static variables are prefixed with $
.
To change this setting:
- Navigate to Apps > Manage your Apps > Issue Templates for Jira > Configuration > Variables.
- Select a Static type of a variable.
- In the custom variables section, click Change prefix.
- Change the prefix.
- Click Save.
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)TipYou can find the ID in the URL of a configuration of a custom field. See Atlassian support for details.
Steps
-
Add variables to your template in your repository project.
-
Go to an issue you want to apply a template on.
-
Apply the template on the issue.
InfoSee Apply template for details.
Result
The template is applied keeping original user input.