Field codes

One of the most important features of JWT is the easy accessibility to Jira data stored in system fields, custom fields and a significant number of other virtual fields that are made available by the JWT implementation.

You can access, validate, do mathematical calculations and manipulate the values found in these fields through the use of field codes .  

A field code is a unique identifier (key) that can be used in any JWT expression editor. At the same time a field code is a safety feature that makes your expressions immune to custom field renaming.

Overview

Field codes will be automatically added to your expression when you insert them anywhere using the expression parser field code injector.

Field codes for Jira standard or system fields will display the attribute in a legible form like  %{issue.summary}.

All custom fields will be notated like %{issue.cfnnnnn} where nnnnn contains the Jira custom field ID.

Once an expression has been saved, the real name will be displayed in the configuration element.

The purpose of using the cfnnnnn notation is quite simple -  custom fields can be renamed .


Field code notation

Depending on the context in which they are being used, field codes will contain a prefix following this notation: {origin.field}

What is a context?

A context basically determines where JWT will pull data from. Available contexts (or  origins) in JWT are:

Context

Example

Description

issue

%{issue.description}

The field value will be retrieved from the issue that currently being processed by a workflow function or automation rule.

The most commonly used context in JWT.

parent

%{parent.summary}


The field value will be retrieved from the parent of the issue that is processed by a workflow post function or an automation rule.

 Only valid for sub-tasks.

seed

%{seed.issue.summary}

%{seed.text}

%{seed.number}

The field value will be retrieved from the element currently being processed by a workflow function or automation rule that is capable of analyzing multiple elements (e.g. Create issue post function or the Create issue action).

Elements can be:

  • issues

  • texts

  • numbers

depending in your configuration. Read more about Seeds.

action

%{action.status}

The value will be retrieved from the response of the executed remote action. 

Currently only available in the Execute remote action post function.

function

filterByPredicate(subtasks(), {function.issue.dueDate} != null)

This example returns a list of all sub-tasks of the current issue that have a due date set.

The field value will be retrieved from issue(s) returned by some JWT expression parser functions.

Mostly these are functions that return an issue list (e.g. subtasks()).

Some functions iterate (loop) over all elements returned by a list. As soon as each element of the list is being processed, this element is the temporary context.

created.parent

%{created.parent.summary}

The field value will be retrieved from the new parent issue of a sub-tasks being created in a workflow post function.

Currently only available in the Create issue post function and only valid for sub-tasks.

Additional context for automation rules

An issue is tied to a workflow. This is why most field codes in JWT workflow functions have their issue context. Automation rules are not tied to individual issues. This is why sometimes it is necessary to define their context separately.

These additional contexts are available for automation rules:

Context

Description

Example

trigger

The issueuserversioncomponent or project event that triggers the execution of the rule.

%{trigger.issue.description}

The description of the issue triggering the automation rule.

selector

The  issue currently being processed by a selector  (e.g. an issue returned by a JQL query).

%{selector.issue.cf10021}

The value of the custom field with the ID 10021 from the issue currently being processed by a selector.

The  prefix is a referential part of the field code and will be inserted into the expression whenever you select a field from a dropdown list (as shown below).   


The additional contexts can be used in combination with the standard contexts (e.g. parent, seed).

Example: %{trigger.parent.summary}

Find a full list of automation-only field code here: Field codes (automation-only)

Number vs. text field code notation

Field codes must always be enclosed by curly brackets {} but if they are used for text-strings, the brackets must be preceded by a percent sign %

  • Numeric fields can be referenced as numbers using the following notation: {issue. somenumberfield }. ( info  no preceding % sign)

    • If a field is not set or does not return a number (e.g. a text field ), it is evaluated to null.

  • Text fields : Any field type or data type can be transformed to text, so any field can be referenced as a text-string value using the following notation: %{issue.somefield}.

    • If a field has no value ( null) , an empty text will be returned.

  • Cascading Select fields are treated as text fields, where i is the index that represents the level to be accessed. ( i = 0 is used for base level) are notated as %{issue.somefield.i}

A complete list of all available data types can be found here.


Available field codes

Check out the following pages to familiarize yourself with the different types of field codes.

Field name Field code Type Example output
Jira base URL

%{system.baseUrl}

read-only

https://www.atlassian.net/jira

Project lead's full name

%{issue.project.lead.displayName}

read-only

Bob Smith

Attachments (current attachments will be replaced)

No field code

write-only

Creator's full name

%{issue.creator.displayName}

read-only

Bob Smith

Current user's email

%{system.currentUser.email}

read only

user@example.com

Last comment

%{issue.lastComment}

Read / Write

Take your Jira to the next level by using xApps!

Priority

%{issue.priority}

Read / Write

Blocker

Assignee

%{issue.assignee}

Read / Write

admin.istrator

Component lead

%{trigger.component.lead}

read-only

admin.istrator

Remote links

%{issue.remoteLinks}

read-only

https://www.first-example.com,

https://www.second-example.com

Recent attachments

%{issue.recentAttachment}

read-only

Screenshot 2022-03-02 at 08-34-53 - Jira Workflow Toolbox Cloud - Global Site.png

Affects version/s

%{issue.versions}

Read / Write

1.0, 1.1

Version project ID

%{trigger.version.projectId}

read-only

10000

Last commenter

%{issue.lastComment.author}

read-only

admin.istrator

Component default assignee

%{trigger.component.defaultAssignee}

read-only

admin.istrator

Project lead's email

%{issue.project.leadEmail}

read-only

user@example.com

User full name

%{trigger.user.fullName}

read-only

Bob Smith

Fix version/s

%{issue.fixVersions}

Read / Write

1.0, 1.1

Project type

%{issue.project.type}

read-only

Service

Component leads

%{issue.components.leads}

read-only

admin, d.smith

Temporary number

{issue.temporaryNumber1} ... {issue.temporaryNumber5}

read / write

10

Summary

%{issue.summary}

Read / Write

This is my summary

Original estimate (minutes)

{issue.originalEstimate}

Read / Write

120

New watchers

No field code

write-only

Assignee's full name

%{issue.assignee.displayName}

read-only

Bob Smith

Due date

%{issue.dueDate}

Read / Write

19/Mar/20

Version archived

%{trigger.version.archived}

read-only

true, false

Affects version/s with details

%{issue.versions.details}

read-only

1.0 # First release # RELEASED ON 28/Mar/22 12:00 AM # ARCHIVED

Sprint end date

%{issue.sprintEndDate}

read-only

2020-02-17 07:46

Reporter's email

%{issue.reporter.email}

read-only

user@example.com

Sprint completion date

%{issue.sprintCompletionDate}

read-only

2020-02-17 07:46

Workflow scheme

%{issue.workflowScheme}

read-only

Global scheme

Project key (trigger)

%{trigger.project.key}

read-only

CRM, HR, SDESK

Add to parent's total time spent (minutes)

No field code

write-only  

User directory user

%{trigger.user.directoryUser}

read-only

admin.istrator

Remaining estimate (minutes)

{issue.remainingEstimate}

Read / Write

120

Project URL (trigger)

%{trigger.project.url}

read-only

https://www.decadis.de/x

Reporter

%{issue.reporter}

Read / Write

admin.istrator

Version release date

%{trigger.version.releaseDate}

read-only

2020-02-17 07:46

User directory ID

%{trigger.user.directoryId}

read-only

10001

Project lead's full name (trigger)

%{trigger.project.leadDisplayName}

read-only

user@example.com

Project category (trigger)

%{trigger.project.category}

read-only

Assignee's email

%{issue.assignee.email}

read-only

user@example.com

Temporary text

%{issue.temporaryText1} ... %{issue.temporaryText5}

read / Write

This is a text stored temporarily

Version start date

%{trigger.version.startDate}

read-only

2020-02-17 07:46

Project lead

%{issue.project.lead}

read-only

admin.istrator

Environment

%{issue.environment}

Read / Write

Data Center

Current user's full name

%{system.currentUser.displayName}

read-only

Bob Smith

Number of linked issues

{issue.links.count}

read-only

3

Date and time of creation

%{issue.created}

read-only

19/Mar/20 1:38 PM

Version description

%{trigger.version.description}

read-only

This is version 1.0

Total time spent (minutes)

{issue.timeSpent}

Read / Write

120

Previous issue status

%{issue.status.previous}

read-only

Closed

Keys of linked issues

%{issue.links}

read-only

CRM-13, HR-12, SDESK-45

User key

%{trigger.user.key}

read-only

admin.istrator

Keys of sub-tasks

%{issue.subtasks}

read-only

CRM-23, CRM-26, CRM-31

Recent attachments with details

%{issue.recentAttachment.details}

read-only

Team name

%{issue.teamName}

read-only

Team HR

Version ID

%{trigger.version.id}

read-only

10000

Current user

%{system.currentUser}

read-only

admin.istrator

Add to time spent (minutes)

No field code

write-only  

Watchers

%{issue.watcher}

Read / Write

username1, username2, username3

New labels

No field code

write-only

Number of labels

{issue.labels.count}

read-only

3

Issue key

%{issue.key}

read-only

CRM-25

Project description (trigger)

%{trigger.project.description}

read-only

Component ID

%{trigger.component.id}

read-only

10000

Project description

%{issue.project.description}

read-only

This is the CRM project.

Execute transition

No field code

write-only

Version name

%{trigger.version.name}

read-only

Version 1.0

User is active

%{trigger.user.isActive}

read-only

true, false

Number of affects version/s

{issue.versions.count}

read-only

42

Customer Request Type Name

%{issue.customerRequestTypeName}

read-only


New comment

No field code

write-only

User name

%{trigger.user.name}

read-only

admin.istrator

Action response details

%{action.response.JMESPath}

read-only

PROJ 

Issue type

%{issue.issueType}

read-only

Bug

Attachments

%{issue.attachments}

read-only

file1.txt, readme.pdf, screenshot.png

New comment (sends email notifications)

No field code

write-only

Project key

%{issue.project.key}

read-only

CRM

Project URL

%{issue.project.url}

read-only

https://www.decadis.de/x

Project ID

%{issue.project.id}

read-only

10001

Version sequence

%{trigger.version.sequence}

read-only

1

Creator

%{issue.creator}

read-only

admin.istrator

Date and time of last update

%{issue.updated}

read-only

User ID

%{trigger.user.id}

read-only

10000

Number of votes received

{issue.votes}

read-only

Number of attachments

{issue.attachments.count}

read-only

3

Project category

%{issue.project.category}

read-only

Archive

Execute transition (delayed execution)

No field code

write-only

Number of sub-tasks

{issue.subtasks.count}

read-only

3

Version project

%{trigger.version.project}

read-only

CRM

Component/s

%{issue.components}

Read / Write

Web Site, Authenticator, Statistics

Issue status category

%{issue.status.category}

read-only

Done

Sprint start date

%{issue.sprintStartDate}

read-only

2020-06-08 12:10

Issue status (delayed writing)

No field code

write-only

Action response

%{action.response}

read-only

{"self": "https://your-domain.atlassian.net/jira/rest/api/3/project/10042","id": 10010,"key": "PROJ"} 

Project lead's email (trigger)

%{trigger.project.leadEmail}

read-only

user@example.com

Number of fix version/s

{issue.fixVersions.count}

read-only

2

Labels

%{issue.labels}

Read / Write

web customer java mobile

Attachments with details

%{issue.attachments.details}

read-only

file1.txt (text/plain, 5.14 KB), readme.pdf (application/pdf, 179.8 KB), screenshot.png (image/png, 5.449 KB)

Action status

%{action.status}

read-only

200

Reporter's full name

%{issue.reporter.displayName}

read-only

Bob Smith

Remaining issues in project

%{issue.remainingIssuesInProject}

read-only

CRM-1, CRM-2, CRM-3, CRM-4

Date and time of last status change

%{issue.lastStatusChange}

read-only

19/Mar/14 1:38 PM

Security level

%{issue.securityLevel}

Read / Write

Classified

Description

%{issue.description}

Read / Write

Take your Jira to the next level by using JWT!

Current date and time

%{system.currentDateTime}

read-only

19/Mar/20 1:38 PM

Resolution

%{issue.resolution}

Read / Write

Resolved

Component name

%{trigger.component.name}

read-only

Project name (trigger)

%{trigger.project.name}

read-only

Customer Relationship Management

Last comment's visibility restriction

%{issue.lastComment.visibility}

Read / Write

jira-administrators

Available target statuses

%{issue.status.achievable}

read-only

In Progress, Resolved, Closed

Date and time of resolution

%{issue.resolutionDate}

read-only

Issue status

%{issue.status}

Read / Write

Open

Version released

%{trigger.version.released}

read-only

true, false

Component description

%{trigger.component.description}

read-only

This is a component

Creator's email

%{issue.creator.email}

read-only

user@example.com

User email

%{trigger.user.email}

read-only

user@example.com

Previous issue status category

%{issue.status.previousCategory}

read-only

Done

Project lead (trigger)

%{trigger.project.lead}

read-only

admin.istrator

Sprint ID

%{issue.sprintId}

read-only

1

Fix version/s with details

%{issue.fixVersions.details}

read-only

1.0 # First release # RELEASED ON 28/Mar/22 12:00 AM # ARCHIVED

Available transitions

%{issue.transition.achievable}

read-only

Start Progress, Resolve Issue, Close Issue

Project name

%{issue.project.name}

read-only

Attachments (only new attachments will be added)

No field code

write-only