Apps documentation
Issue Templates for Jira
Cloud Server/Data Center
Issue Templates for Jira

Cloud

Server/Data Center

Documentation
FAQ
Release notes
Articles & Videos
Last updated Aug 11, 2024

How to use smart defaults

The smart defaults feature is a very powerful tool provided by Issue Templates Cloud. In this chapter you can find examples showing how to use smart defaults in your project.

Try live demo:

Note

Smart defaults overwrite Template scope.

How to access issue fields?

You can use the following methods to access issue fields:

issue - will access a field for which it is configured

issue.fix_versions - provide short form of field name with _ instead of space in case you want to configure it for other field e.g. Affects Versions

issue.field("Fix versions") - use field expression with an exact name if your field contains special characters

issue.customfield_10330 - use custom field key in case you have more than 1 field with the same name

Example

If the Fix Versions field is set to 1.0.2 and 1.0.3 versions:

issue.field("Fix versions")

// returns
1.0.2, 1.0.3

Set relative dates

With a now + 5d expression you can set a relative date in date type fields. +5d or -5d is a shortcut for .plusBusinessDays(5) or .minusBusinessDays(5).

As a source of the date you can use now, issue properties like issue.created, other date fields or inherited fields, for example, parent.due_date.

Supported syntax:

  • [date] [+-] [dw] d - business days, w - business weeks
  • [date].plus[unit]
  • [date].miunus[unit]

Supported units:

  • Days
  • BusinessDays
  • Weeks
  • Months
  • Quarters
  • Years
  • Millis
  • Seconds
  • Minutes
  • Hours

Supported actions:

  • Set a date relative to current time, for example: now + 5d now.plusDays(3)
  • Set a date relative to other issue field or property, for example: issue.created + 5d issue.due_date.minusDays(2)
  • Set relative dates based on parent date field, for example: parent.due_date + 5d
  • Set a date relative to :date variable, for example: variable("Launch date") + 5d
Tip

See Smart expressions for the full list of commands.

Multiselect

Smart defaults support multiselect. You can define more than one value for multiselect fields. Simply separate values with a comma (,).

Example

Components = Backlog, Roadmap

The following fields are supported:

  • Checkboxes
  • Components
  • Fix versions, Affects versions
  • Group Picker
  • Labels
  • Select List
  • User Picker
  • Version Picker

Use case 1 - Implementing a new feature

In this scenario, a user wants to have a template that would automate the process of implementing a new feature. With smart defaults, the process can automate:

  • filling the starting date
  • setting a deadline
  • setting a reporter and assigning an issue to a specific role or person
  • creating a label for this feature
  • setting a version
Issue Templates for Jira Cloud: Static Variables
Smart defaults use case

In this case, smart defaults are configured as follows:

  1. Start date - set to now, so it will automatically fill the start date as the day it was created. Thanks to smart defaults and static variables, this date will be automatically added to the custom field and description. In this case it corresponds with a custom field #10015, but it can be any custom field of a date picker type.
    Tip

    See Atlassian support for details on checking the ID of a custom field.

  2. Due date will set a deadline for the process. In this case, it will add 10 business days to the start date using smart dates .
  3. A person who creates an issue will be assigned as a reporter.
  4. The issue will be assigned to a specific role, in this case the project lead.
  5. A label will be automatically created that corresponds with the name of the feature. The label refers to the value you have set in the dynamic variable.
  6. You can set the version here. The fix version field is based on the value set as the dynamic variable.

The feature name will be automatically applied to the referred fields, such as the summary, new feature idea in the description and the label in this case.

Once the template is configured, the user can navigate to the create from template option to use it.

You will be asked to fill in the feature name, description (user story), and the version.

Issue Templates for Jira Cloud: Static Variables
Smart defaults use case

Result

The output looks like this:

Issue Templates for Jira Cloud: Static Variables
Smart defaults use case

Use case 2 - Preparing a timeline for a complex task with multiple steps

In this scenario, a user wants to plan an event and add steps in form of a timeline. With smart defaults you can offset dates easily, as well as copy values from parent and linked issues. An epic is created that corresponds with planning steps. Steps are added as stories and an epic for a corresponding process that happens simultaneously is linked.

Issue Templates for Jira Cloud: Static Variables
Smart defaults use case

Child issues are configured using smart defaults to shift one week forward and copy components and the assignee from the parent.

Issue Templates for Jira Cloud: Static Variables
Smart defaults use case

The linked epic is also configured to copy the due date from the main task and shift it in time.

Issue Templates for Jira Cloud: Static Variables
Smart defaults use case

Result

Both epics have been created and child issues with set values have been applied.

Issue Templates for Jira Cloud: Static Variables
Smart defaults use case

Child issues copied the assignee, components, and shifted the date as configured.

Issue Templates for Jira Cloud: Static Variables
Smart defaults use case
Issue Templates for Jira Cloud: Static Variables
Smart defaults use case

Due date of the linked epic has also been shifted.

Issue Templates for Jira Cloud: Static Variables
Smart defaults use case
Tip
With this feature you can automatically set timelines for your processes and copy necessary values from linked issues.

Use case 3 - Linking an epic with smart defaults

You can configure an epic link or a parent in smart defaults so that it will link to an already-existing epic. This way templates will automatically link to the specified epic in this project or another.

Issue Templates for Jira Cloud: Static Variables
Smart defaults use case
Issue Templates for Jira Cloud: Static Variables
Smart defaults use case