Smart Variables

Enhance your Templates by incorporating Smart Variables for Date, Date Time and Reporter.

 

Contents 👇🏼

Date and Date Time Smart Variables

Overview

Smart Templates for Jira introduces the powerful feature of Smart Variables, specifically designed to automate the insertion of dates into your Jira issues. These variables can be used within text fields like Summary, Description, and also within Jira field types such as Date Picker and Date Time Picker.

By using Smart Variables, you can dynamically populate fields with relevant dates and times, reducing manual input and ensuring consistency across your Jira issues created from a tempalte.

Possible options of Date and Time Smart Variables

Base variable

Syntax

Details

Base variable

Syntax

Details

now

{{now}}

Use the {{now}} variable to automatically insert the date when Jira Issues are generated from a template.

Methods to add dates

Methods to Subtract dates

Details

now.plusDays(x)

now.minusDays(x)

The date is generated by adding or subtracting calendar days from the current date when creating issues with a template.

now.plusWeeks(x)

now.minusWeeks(x)

Adding or subtracting weeks

now.plusMonths(x)

now.minusMonths(x)

Adding or subtracting months

now.plusBusinessDays(x)

now.minusBusinessDays(x)

Adding or subtracting business days

Using Smart Variables in Date or Date Time field types

  1. Open edit page of a template where Date or Date Time pickers are available.

  2. Click on “Use variable“ under the field

Screenshot 2024-08-15 at 19.24.22.png
  1. Fill in the field(s) with smart variables and save your template.

☝🏼NOTE: The time part of the Date Time picker field reflects the exact time when the issue is created, irrespective of the methods employed in the variable.

Screenshot 2024-08-15 at 19.48.13.png
  1. And now let’s create issue(s) from the template and see the actual values inserted into the fields.

💡HINT: Multiple methods can be combined within a single field to obtain more accurate date values. For instance, a combination like now.plusMonths(3).plusWeeks(1).minusDays(2) can be used. In this scenario, when the template is applied on Aug 15, 2024, the mentioned string will be replaced with Nov 20, 2024.

Using Smart Variables in the Text field types

You can also use Date and Time Smart Variables in text fields by enclosing them in double curly braces, such as {{now.plusMonths(3)}}. Simply insert your variable into the Description, Summary, or any other field within your template.

All variables in the text fields will be automatically replaced by the corresponding date and time values, based on your Jira instance time, when issues are created from a template.

Reporter Smart Variable

Overview

The {{reporter}} Smart Variable dynamically inserts the name of the user creating the issue from a template. It can be used in both User Picker fields and Text fields within Smart Templates, allowing for personalized and context-aware issue creation.

Using Reporter Smart Variable in User Picker field type (coming soon 🔥)

  1. Access the template that includes User Picker fields, such as Assignee or any custom User Picker field.

  2. Find the specific User Picker field in the template where you want to use the reporter variable. Click on the "Use variable" option available under the selected User Picker field.

  1. In the field that appears, type the word “reporter”.

  1. From this point forward, whenever an issue is created from this template, the User Picker field configured with the {{reporter}} variable will automatically be populated with the user who created the issue (applied a template)

Using Reporter Smart Variable in Text fields

You can also use the {{reporter}} smart variable in text fields like Summary and Description to dynamically include the reporter's information.

The created issues will look like the following example: