Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Div
idProductTOC

On this page

Table of Contents
maxLevel3
minLevel1
excludeOn this page
typeflat
separatorpipe
Section
column

Description

Substitution variables provide powerful capabilities to customize the creation of issues.

...

Variables provide text string representations of fields useful for inclusion in other fields.

  • Setting field values from other fields and custom field values.

  • Constructing conditioning values.

  • For multi-issue creation scenarios.

The syntax for referencing substitution variables is: %<variable name>%. All text entry fields support replacement. 

Example: %parent_summary%

...

Variables

...

Substitution variables

Several example substitution variables are listed on the post function

...

screen as an aid when creating definitions.

...

However, the table below contains a more complete and detailed list

...

of substitution variables available as you work with the

...

Note the terminology for the meaning of parent and original.

Tip
titleCustom fields

Custom fields are identified by name or id (like customfield_12345). By name is easier to know what it is referring to but by id will survive renaming a custom field.

...

Create Issue or Create Sub-task post function.

Table: containing valid substitution variables and their descriptions.

Table plus

Substitution Variable

Description

user_id

User

id

ID of user that is considered to be doing the transition

Since 3.3.

user_name

Display name of user that is considered to be doing the transition

Since 3.6.

entry

Entry from multiple issues processing

Since 3.3. Example: How to condition the creation of issues.

now

Current date/time in

JIRA

Jira complete date/time format or a specific format 

Since 4.2.

project, parent_project, original_project, entry_project

Project key of the issue

Qualified entries since 4.1.

project_id, parent_project_id, original_project_id, entry_project_id

Project

id

ID (numeric) of the issue

Since 4.3.

project_name, parent_project_name, original_project_name, entry_project_name

Project name for the issue

Since 5.3

project_category, parent_project_category, original_project_category, entry_project_category

Project category name for the project of the issue

Since 4.0. Blank if the

project

does not have a category configured. Qualified entries since 4.1.project

_lead, parent_project_lead, original_project_lead, entry_project_lead

User

id

ID of the project lead

.Since 4.1

.

project_default_security, original_project_default_security, entry_project_default_security

Default issue security level name for the project

project_default_security_id, original_project_default_security_id, entry_project_default_security_id

Default issue security level id for the project

parent_key, original_key

Issue key

parent_id, original_id, entry_id

Issue numeric

idSince 4.2

ID

parent_sprint, original_sprint

For a Sprint custom field set the sprint value using the specified substitution variables when the parent/original issues have one or more sprints assigned.

parent_summary, original_summary

Summary

parent_description, original_description

Description

parent_environment, original_environment

Environment

Since 4.0

parent_issuetype, original_issuetype

Issue type

Since 4.0

parent_status, original_status

Issue status

Since 4.0

parent_priority, original_priority

Priority

Since 4.0

parent_reporter, original_reporter

Reporter user

id

ID

parent_assignee, original_assignee

Assignee user

id

ID

parent_components, original_components

Comma-separated list of components

Since 4.0

parent_component_descriptions, original_component_descriptions

Comma-separated list of component descriptions. Some may be blank.

Since 5.2

parent_affected_versions, original_affected_versions

Comma-separated list of affected version names

parent_fixed_versions, original_fixed_versions

Comma-separated list of fixed version names

parent_subtasks, original_subtasks

Comma-separated list of subtask issue keys

Since 4.0.

parent_duedate, original_duedate

Due date in

JIRA

Jira DMY date format or a specific

formatSpecific is available since 3.6.

parent_created, original_created

Created date in

JIRA

Jira complete date/time format or a specific format 

Specific format is available since 3.6.

parent_updated, original_updated

Update date in

JIRA

Jira complete date/time format or a specific format 

Specific format is available since 3.6.

parent_resolution, original_resolution

Resolution

Since 4.0.

parent_resolution_date, original_resolution_date

Resolution date in

JIRA

Jira complete date/time format or a specific format 

Specific format is available since 3.6.

parent_labels, original_labels

Blank separated list of labels

Since 3.1.

parent_labels_comma_separated, original_labels_comma_separated

Comma-separated list of labels

Since 3.3.

parent_watchers, original_watchers

Comma-separated list of watcher user

idsSince 3.1.

IDs

parent_watches, original_watches

Number of watchers of the issue

Since 4.0.

parent_votes, original_votes

Number of votes for the issue

Since 4.0.

parent_time_spent, original_time_spent

Time spent on the issue in minutes

Since 4.0. Note the JIRA timeSpent field returns seconds.

parent_estimate, original_estimate

Current estimate for the issue in minutes

Since 4.0.

parent_original_estimate, original_original_estimate

Time spent on the issue in minutes

Since 4.0. Note the 2 different meanings of the original word here (smile).

parent_security_level, original_security_level

Security level name

Since 3.2.

<field name>

Parent issue's

JIRA

Jira issue field value

Deprecated but still active, recommend using specific replacements variables instead

Examples: components, resolution. See JIRA issue field contstants.

JIRA defines what information is returned by these fields.

<customfield name>

parent_<customfield name> (since 3.4)

Parent issue's custom field value

Recommend using prefix qualified name for clarity

Must be an exact match including case and blanks.

JIRA defines what information is returned by these fields.

<customfield_id>

parent_<customfield_id> (since 3.4)

Parent issue's custom field value

Example: customfield_10010.

JIRA defines what information is returned by these fields.

original_<customfield name>

Original issue's custom field value

Since 3.4. Similar to above.

Useful for sibling create scenarios.

original_<customfield_id>

Original issue's custom field value

Since 3.4. Similar to above.

Example: original_customfield_10010.

transition_comment

Comment entered on the transition screen

transition_user_id

Actual transition user

id

ID even if using acting support

Since 4.1.

transition_user_name

Actual transition user name even if using acting support

Since 4.1.

jql_result_count

Number of issues returned by the query

Since 3.3.

jql_result_list

Comma-separated list of issue keys returned from the query

Since 3.3.

jql_result_n

The issue key for the nth issue returned from the query where n is a number

Since 3.3. Blank if n is not in range for the issue list.

pattern1_n

nth capture group from condition pattern 1

Since 3.3. Blank if n is not in the range of valid capture groups.

pattern2_n

nth capture group from condition pattern 2

Since 3.3. Blank if n is not in the range of valid capture groups.

property_<property name>

Transition property. Other transition functions can add transition properties that can be referenced. This provides a way to access those transition properties. You must know the property name.

Since 4.2 (and 4.6)

Examples:

  • org.swift.jira.cot.last_created_key

  • org.swift.jira.cot.last_created_non_subtask_key (4.6)

  • org.swift.jira.cot.created_key_list

  • org.swift.jira.acli.validator_message - result message from last CLI action validator

  • org.swift.jira.acli.function_message - result message from last CLI action post function

group_<group name>

Comma separated list of user ids for members in the group

Since 3.3. Example: group_jira-users.

role_<role name>

Comma separated list of user ids for users that are role actors for the project of the original issue

Since 3.3. Example: role_developers.

values_<customfield name>

values_<customfield_id>

For special use cases only needing access to the field configuration.

Comma-separated list of custom field option values in the context of the original issue

Tip

This is for accessing the configuration of the custom field and NOT the values of a custom field for an issue (see custom field value substitution variables mentioned above)

.Since 3.6. Custom field should be of a type that has option value like multi-select or cascade select

.

For cascade select fields, it is a list of parent option values.

values_<customfield name>(<value or sub variable>)

values_<customfield_id>(<value or sub variable>)

For special use cases only needing access to the field configuration.

Comma-separated list of cascade select child option values for the specific parent value provided.

Tip

This is for accessing the configuration of the custom field and NOT the values of a custom field for an issue (see custom field value substitution variables mentioned above).

Since 3.6. Primarily used for advanced scenarios for multi-issue creation scenarios using entry substitution variable. See How to use a cascade select configuration to provide a value map.

Examples: values_custom-cascade-select(entry), values_custom-cascade-select(1)

function_<function name>(<parameters>)

  • earliestUnreleasedVersion(projectKey)

  • latestReleasedVersion(projectKey)

  • versionId(projectKey, versionName)

  • fieldValue(issueKey, fieldName)

  • list(startNumber, endNumber)

  • findReplace(text, replacement)

  • userName(userId)

  • versionInfo(projectKey, versionName, request, dateFormat) 

  • groupMemberList(groupName)

  • componentLead(projectKey, componentName)

  • linkedIssues(issueKey, linkType)

Functions that derive useful text values that can be used as substitution variables. Some are similar to their equivalent JQL function (follow link). The parameter(s) may be a substitution variable.

Tip
tilte

Make sure you use the correct syntax!

titleMake sure you use the correct syntax!

Set custom field: field: My custom field, value: %function_earliestUnreleasedVersion(%project%)%

Since 4.0. Open an improvement request if you have similar needs.

  • Version id is since 4.3
  • Field value is since 4.5

  • List since 5.0
  • FindReplace since 5.0
  • UserName since 5.1
  • VersionInfo since 5.1
  • GroupMemberList since 5.1
  • ComponentLead since 5.2
  • LinkedIssues since 5.7
  • Example: function_earliestUnreleasedVersion(%project%)


    cli_replace_<name>

    Many Atlassian CLI products support setting replacement variables during the running of actions in order to facilitate use in a subsequent actions.

    JCLIP

    Run CLI Actions in Jira workflow functions will take these replacement variables from the running of a CLI action and populate the transition properties so they can be available in subsequent functions as substitution variables. Use the prefix and the replacement name from the lists shown on the replacement variables page after running a CLI action function that produces replacement variables.

    Since 4.0.

    Example: cli_replace_issue will be replaced with the issue key of the last created issue after the createIssue action is run by a CLI action function

    Working with custom fields

    Custom fields are identified by either name or id (e.g., customfield_12345). Referencing a custom field by its name is often easier to know what the value is referring to. Yet, by referencing custom fields by their id will allow the configuration to survive the renaming of a custom field.

    Anchor
    configured-date-format
    configured-date-format

    Configured date format

    For date substitution variables, the format of the replacement variable can be specified if the default format is not desirable. The format is specified by a Simple Date Format string enclosed in parenthesis following the substitution variable name. For example: %created(yyyy-MM-dd)% will result in replacement like 2013-05-28.