Make Your Templates More Dynamic with Variables

It makes no sense for your team to lose time on creating many similar JIRA issues when they can easily benefit from issue templates.

If your team faces the task of creating iterative issues, you can help them get the job done more efficiently with our plugin, Issue Templates.

Templates work wonders for team productivity because they simplify the entire process of creating new issues.

Why is that? Templates automatically populate issue fields with predefined values, or use a smart copy post-function to help users create plenty of new issues in no time.

In this tutorial, we’ll show you how to use variables to create advanced templates for your issues.

 

Variables in Templates – the Basics

Variables help to create templates that contain dynamic or static information. This data is then evaluated into actual values when a user applies the template for creating an issue.

There are two types of Variables that can be used in Issue Templates: Dynamic and Static.

Dynamic Variables

These variables are basically placeholders (also called markups) in a template filled with any value which is typed into the placeholder.

With dynamic variables, users don’t need to type in the same information over and over again into their issues.

For example, a user who wants to create an iterative issue can fill in their ‘name’ in the user field of the issue. Their ‘name’ will then be used to autofill the dynamic variable called ‘[user]’ when the issue is created or a template applied.

Static Variables

This type of variables are placeholders in a template that are filled with actual values supplied by the system, where each variable refers to a specific field of the JIRA instance while the issue is created.

Static variables are similar to the current system properties.

For example, “$USER_NAME” refers to the full name of the user creating the issue and “$TODAY” will refer to the current date that the issue was created or applied.

You can also define your own variables.

 

Impact of Variables on JIRA Issues

When you create an issue using a template that contains dynamic variables placeholders, you will be presented with a selection of placeholder fields where you can enter values.

The issue template will analyze the template in search of placeholders that require a field value and once it finds such a placeholder, the Create issue screen will show users a section where they can define values for the placeholder fields.

Static variables will refer to the appropriate values when a user chooses a template that includes autocomplete values.

Unlike dynamic variables, users can’t modify static variables while creating or applying a template because the values for these variables are supplied by the system.

 

A Short Guide to Static Variables

The markup for Static Variable always begins with the $ sign, for example: $today, $now, $reporter_name. The sign appears there by default, but can be modified in the Cloud version of the plugin.

To use static variables, you need to place the markup for them in the template text field or template sub-task where you want the resolved value to appear.

Here’s a selection of default static variables in JIRA.

A JIRA administrator can add a new static variable with a constant value as well. Head over to Configuration>Variables>Static to do that.

 

Everything You Wanted to Know About Dynamic Variables

First, where can users place dynamic markup?

Dynamic variables can appear in the following fields:

  • Summary
  • Description
  • Any other textual Custom Field

To make dynamic variables visible in your forms, you can surround them by a {color:red} {color} tag. To do this, edit the template field by surrounding the variable with a tag: {color:red} [user] {color}

 

Using Variables as a Select and Multiselect

To create a single selection with variables you need to set up a specific pattern after the variable name using the “|’ as a separator.

Example: [State|California|Massachusetts|Ohio]

To create multiple selection with variables, set up a pattern after the variable name using the “|’ as a separator and start (*) after variable name.

Example: [State*|California|Massachusetts|Ohio]

To sum up, in dynamic variables, you can:

  • Autocomplete values – but only in non-text fields;
  • Copy values and create issues;
  • Create sub-tasks for new issues;
  • Copy sub-tasks – only in text fields
  • Apply template – only in non-text fields

 

How to Use Variables in Templates

To make the most out of the dynamic information in your templates, make sure to follow these steps:

  • Enable your issue template;
  • Put an example variable in the description field, like [username];
  • Ensure that the description field is in the Autocomplete Scope;
  • Check the results by selecting the prepared template on the Create Issue screen.

 

Key Takeaway

With Issue Templates, you team can handle not only simple issue templates but also complex ones that feature different types of variables.

Head over here to get a free trial and see how Issue Temples for JIRA can boost your team’s productivity.

 

About Krzysztof Skoropada

As a Head of Atlassian Apps, together with a team of 130 experts, I help companies select the correct plugin for Atlassian according to their individual needs. I am proud of the fact that more than 2 million people from companies such as listed below are trusted clients: CISCO, Ferrari, Samsung, KBC Bank, Deloitte, Allianz, Blizzard Entertainment, Lufthansa, Walmart, Spotify, Sony, MetLife and many more.
Comments are closed.