Jira CLI replacement variables

Jira CLI replacement variables

When you run actions using run, runFromList, runFromCsv, or other similar commands, the ACLI client sets internal variables that you can reference in subsequent actions. These replacement variables help automate workflows by reusing data generated earlier in the script, such as issue keys, URLs, or IDs.

You can access replacement variables using the syntax @variable@.


Jira-specific replacement variables

The table below lists replacement variables that are automatically set when running actions against Jira. The availability of each variable can depend on the CLI client version or the specific action used.

Variable name

Description

Since

Variable name

Description

Since

project

Last created, found, or referenced project key

 

projectId

Last created, found, or referenced project ID (numeric)

 

projectUrl

Last created, found, or referenced project URL

8.4

projectType

Last referenced project type (software, business, service_desk)

9.5

projectStyle

Last referenced project style (classic, next-gen)

9.5

issue

Last created or referenced issue key (not a subtask)

 

issueId

Last created or referenced issue ID (numeric)

 

issueUrl

Last created or referenced issue URL

8.4

subtask

Last created subtask key

 

subtaskId

Last created subtask ID (numeric)

 

subtaskUrl

Last created subtask URL

8.4

parent

Last referenced parent issue key

 

parentId

Last referenced parent issue ID (numeric)

 

parentUrl

Last referenced parent issue URL

8.4

clone

Last created clone issue key

 

cloneId

Last created clone issue ID (numeric)

 

cloneUrl

Last created clone issue URL

8.4

attachment

Last created or referenced attachment name

8.4

attachmentId

Last created or referenced attachment ID (numeric)

8.4

attachmentUrl

Last created or referenced attachment URL

8.4

attachmentThumbnailUrl

Last referenced attachment thumbnail URL

8.4

version

Last created or referenced version name

4.5

versionId

Last created or referenced version ID (numeric)

4.5

component

Last created or referenced component name

4.5

componentId

Last created or referenced component ID (numeric)

4.5

workflow

Last referenced workflow name

 

group

Last referenced group name

4.5

commentId

Last referenced comment ID (numeric)

5.2

commentBody

Last referenced comment body

9.3

commentVisibilityType

Last referenced comment visibility type

9.3

commentVisibilityName

Last referenced comment visibility name

9.3

scheme

Last created or referenced scheme name

6.0

schemeId

Last created or referenced scheme ID (numeric)

5.1

permission

Last added or referenced permission

9.3

permissionId

Last added or referenced permission ID

9.3

permissionHolderType

Last referenced permission holder type

9.3

permissionHolderValue

Last referenced permission holder value

9.3

permissionHolderName

Last referenced permission holder name

9.3

screen

Last referenced screen name

6.0

screenId

Last referenced screen ID (numeric)

5.1

linkType

Last referenced link type (used in runFromLinkList)

6.3

linkTypeId

Last referenced link type ID

6.3

linkDescription

Last referenced link description

6.3

linkId

Last referenced link ID

6.3

fromIssue

Last referenced source issue in a link

6.3

toIssue

Last referenced destination issue in a link

6.3

category

Last added or referenced project category name

6.8

categoryId

Last added or referenced project category ID

6.8

role

Last added or referenced project role name

6.8

roleId

Last added or referenced project role ID

6.8

userId

Last created or referenced user ID

5.7, 9.0

userKey

Last created or referenced user key

9.0

userDisplayName

Last created or referenced user display name

9.0

applicationLink

Last referenced application link name

8.7

applicationLinkId

Last referenced application link ID (numeric)

7.7

applicationLinkUrl

Last referenced application link URL

8.7

remoteLink

Last referenced remote link name

9.3

remoteLinkId

Last referenced remote link ID (numeric)

9.3

remoteLinkUrl

Last referenced remote link URL

9.3

field

Last added or referenced field ID (custom field)

9.3

fieldName

Last referenced field name

9.3

customFieldId

Last added or referenced custom field ID (numeric)

9.3

customFieldType

Last referenced custom field type

9.3

fieldConfiguration

Last added or referenced field configuration

10.1

fieldConfigurationId

Last added or referenced field configuration ID

10.1

filter

Last added or referenced filter name

10.3

filterId

Last added or referenced filter ID

10.3


User-defined variables

You can define your own variables using the reference parameter in supported actions. These variables allow you to capture and reuse values, such as:

  • Issue keys generated in createIssue actions.

  • Field values retrieved using getFieldValue.

The name of the variable is the value you provide in the reference parameter.


Common client variables

These variables are available across CLI clients like Jira, Confluence, Bitbucket, etc.

Variable name

Description

Since

Variable name

Description

Since

entry

Current item from the list parameter in runFromList

 

entry2

Current item from the list2 parameter in runFromList

 

renderRequest

Result from the most recent renderRequest action (after findReplace processing)

 

server

Server URL for the current CLI client

9.0

hosting

Hosting type (server, cloud, or datacenter) from getServerInfo

9.3

version

Server version from getServerInfo

9.3

runDate

Date/time of the first action in the run block; used consistently in all actions in the block

9.0

file

File path from the most recent get or getList action using the file parameter

9.3

fileSize

File size of the retrieved file

9.3

fileContent

Text content of the retrieved file (files must be under 10 MB)

9.3


More information and tips

  • Use the syntax @variable@ to reference variables in your scripts.

  • Variable names are case-sensitive.

  • To see currently available replacement variables within a script, use:

acli --action getReplacementVariableList
  • To set custom variables, use:

acli --action setReplacementVariableList
  • Replacement variables differ from substitution variables, which use a different syntax and purpose.

  • Variables set in runFromList are scoped only to that list iteration. Sibling lists in the same script do not share variables.