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 |
|---|---|---|
|
|
|
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. |
|
|
|
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. |
|
|
|
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:
depending in your configuration. Read more about Seeds. |
|
|
|
The value will be retrieved from the response of the executed remote action. Currently only available in the Execute remote action post function. |
|
|
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. |
|
|
|
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 |
|---|---|---|
|
|
The issue, user, version, component or project event that triggers the execution of the rule. |
%{trigger.issue.description} The description of the issue triggering the automation rule. |
|
|
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}. (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 |
|
read-only |
|
| Project lead's full name |
|
read-only |
Bob Smith |
| Attachments (current attachments will be replaced) |
|
write-only |
|
| Creator's full name |
|
read-only |
Bob Smith |
| Current user's email |
|
read only |
|
| Last comment |
|
Read / Write |
Take your Jira to the next level by using xApps! |
| Priority |
|
Read / Write |
Blocker |
| Assignee |
|
Read / Write |
admin.istrator |
| Component lead |
|
read-only |
admin.istrator |
| Remote links |
|
read-only |
|
| Recent attachments |
|
read-only |
Screenshot 2022-03-02 at 08-34-53 - Jira Workflow Toolbox Cloud - Global Site.png |
| Affects version/s |
|
Read / Write |
1.0, 1.1 |
| Version project ID |
|
read-only |
10000 |
| Last commenter |
|
read-only |
admin.istrator |
| Component default assignee |
|
read-only |
admin.istrator |
| Project lead's email |
%{issue.project.leadEmail} |
read-only |
|
| User full name |
|
read-only |
Bob Smith |
| Fix version/s |
|
Read / Write |
1.0, 1.1 |
| Project type |
|
read-only |
Service |
| Component leads |
|
read-only |
admin, d.smith |
| Temporary number |
|
read / write |
10 |
| Summary |
|
Read / Write |
This is my summary |
| Original estimate (minutes) |
|
Read / Write |
120 |
| New watchers |
|
write-only |
|
| Assignee's full name |
|
read-only |
Bob Smith |
| Due date |
|
Read / Write |
19/Mar/20 |
| Version archived |
|
read-only |
true, false |
| Affects version/s with details |
|
read-only |
1.0 # First release # RELEASED ON 28/Mar/22 12:00 AM # ARCHIVED |
| Sprint end date |
|
read-only |
2020-02-17 07:46 |
| Reporter's email |
|
read-only |
|
| Sprint completion date |
|
read-only |
2020-02-17 07:46 |
| Workflow scheme |
|
read-only |
Global scheme |
| Project key (trigger) |
|
read-only |
CRM, HR, SDESK |
| Add to parent's total time spent (minutes) |
|
write-only |
|
| User directory user |
|
read-only |
admin.istrator |
| Remaining estimate (minutes) |
|
Read / Write |
120 |
| Project URL (trigger) |
|
read-only |
|
| Reporter |
|
Read / Write |
admin.istrator |
| Version release date |
|
read-only |
2020-02-17 07:46 |
| User directory ID |
|
read-only |
10001 |
| Project lead's full name (trigger) |
|
read-only |
|
| Project category (trigger) |
|
read-only |
|
| Assignee's email |
|
read-only |
|
| Temporary text |
|
read / Write |
This is a text stored temporarily |
| Version start date |
|
read-only |
2020-02-17 07:46 |
| Project lead |
|
read-only |
admin.istrator |
| Environment |
|
Read / Write |
Data Center |
| Current user's full name |
|
read-only |
Bob Smith |
| Number of linked issues |
|
read-only |
3 |
| Date and time of creation |
|
read-only |
19/Mar/20 1:38 PM |
| Version description |
|
read-only |
This is version 1.0 |
| Total time spent (minutes) |
|
Read / Write |
120 |
| Previous issue status |
|
read-only |
Closed |
| Keys of linked issues |
|
read-only |
CRM-13, HR-12, SDESK-45 |
| User key |
|
read-only |
admin.istrator |
| Keys of sub-tasks |
|
read-only |
CRM-23, CRM-26, CRM-31 |
| Recent attachments with details |
|
read-only |
|
| Team name |
|
read-only |
Team HR |
| Version ID |
|
read-only |
10000 |
| Current user |
|
read-only |
admin.istrator |
| Add to time spent (minutes) |
|
write-only |
|
| Watchers |
|
Read / Write |
username1, username2, username3 |
| New labels |
|
write-only |
|
| Number of labels |
|
read-only |
3 |
| Issue key |
|
read-only |
CRM-25 |
| Project description (trigger) |
|
read-only |
|
| Component ID |
|
read-only |
10000 |
| Project description |
|
read-only |
This is the CRM project. |
| Execute transition |
|
write-only |
|
| Version name |
|
read-only |
Version 1.0 |
| User is active |
|
read-only |
true, false |
| Number of affects version/s |
|
read-only |
42 |
| Customer Request Type Name |
|
read-only |
|
| New comment |
|
write-only |
|
| User name |
|
read-only |
admin.istrator |
| Action response details |
|
read-only |
|
| Issue type |
|
read-only |
Bug |
| Attachments |
|
read-only |
file1.txt, readme.pdf, screenshot.png |
| New comment (sends email notifications) |
|
write-only |
|
| Project key |
|
read-only |
CRM |
| Project URL |
|
read-only |
|
| Project ID |
|
read-only |
10001 |
| Version sequence |
|
read-only |
1 |
| Creator |
|
read-only |
admin.istrator |
| Date and time of last update |
|
read-only |
|
| User ID |
|
read-only |
10000 |
| Number of votes received |
|
read-only |
|
| Number of attachments |
|
read-only |
3 |
| Project category |
|
read-only |
Archive |
| Execute transition (delayed execution) |
|
write-only |
|
| Number of sub-tasks |
|
read-only |
3 |
| Version project |
|
read-only |
CRM |
| Component/s |
|
Read / Write |
Web Site, Authenticator, Statistics |
| Issue status category |
|
read-only |
Done |
| Sprint start date |
|
read-only |
2020-06-08 12:10 |
| Issue status (delayed writing) |
|
write-only |
|
| Action response |
|
read-only |
|
| Project lead's email (trigger) |
|
read-only |
|
| Number of fix version/s |
|
read-only |
2 |
| Labels |
|
Read / Write |
web customer java mobile |
| Attachments with 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 |
|
read-only |
200 |
| Reporter's full name |
|
read-only |
Bob Smith |
| Remaining issues in project |
|
read-only |
CRM-1, CRM-2, CRM-3, CRM-4 |
| Date and time of last status change |
|
read-only |
19/Mar/14 1:38 PM |
| Security level |
|
Read / Write |
Classified |
| Description |
|
Read / Write |
Take your Jira to the next level by using JWT! |
| Current date and time |
|
read-only |
19/Mar/20 1:38 PM |
| Resolution |
|
Read / Write |
Resolved |
| Component name |
|
read-only |
|
| Project name (trigger) |
|
read-only |
Customer Relationship Management |
| Last comment's visibility restriction |
|
Read / Write |
jira-administrators |
| Available target statuses |
|
read-only |
In Progress, Resolved, Closed |
| Date and time of resolution |
|
read-only |
|
| Issue status |
|
Read / Write |
Open |
| Version released |
|
read-only |
true, false |
| Component description |
|
read-only |
This is a component |
| Creator's email |
|
read-only |
|
| User email |
|
read-only |
|
| Previous issue status category |
|
read-only |
Done |
| Project lead (trigger) |
|
read-only |
admin.istrator |
| Sprint ID |
|
read-only |
1 |
| Fix version/s with details |
|
read-only |
1.0 # First release # RELEASED ON 28/Mar/22 12:00 AM # ARCHIVED |
| Available transitions |
|
read-only |
Start Progress, Resolve Issue, Close Issue |
| Project name |
|
read-only |
|
| Attachments (only new attachments will be added) |
|
write-only |