Versions Compared

Key

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


Page properties
hiddentrue


Tech review

Status
titletodo

Style guide

Status
titletodo

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged



UI Text Box
sizemedium
typeinfo

parsing mode determines how the JWT for Jira Cloud expression parser interprets an expression. 

The available parsing modes depend on the context in which you use the expression. This means for example, that only the Logical mode is available if you configure a conditionalexecution in a workflow post function.


UI Text Box
typeinfo

There are multiple two parsing modes available in the expression parser. The two most commonly used parsing modes are:

  • Basic General: with this simple parsing mode you can write freetext and insert field codes anywhere in your text. These field codes will be replaced at runtime with the corresponding field values of the issue currently being processed. Advanced: with this parsing mode we can do much more complex text composition thanks  Thanks to the usage of functions for replacing substrings, changing cases, reading fields in linked issues, sub-tasks, JQL selected issues, and much more we can do much more complex operations. It requires the text to be parsed to be written as a string expression respecting the parser syntax which is described below.

You can easily switch between parsing modes. The available modes depend on the context!

Please be aware that besides the JWT for Jira Cloud expression parser you can choose to use Jira expressions as a parsing mode in every context.


Multiple available parsing modes

Image Added

Available parsing modes

Page properties report
headingsShort description, Supported elements, Output
cqllabel = "parsing_mode" and space = currentSpace() and ancestor = currentContent()

UI Text Box
typetip

Most functions will accept text values so casting values to text is a very powerful function. Details can be found below in the converting data types section! 

Additionally, you can directly transform a field value to text using the following syntax: %{...somefield}



The advanced parsing mode has a defined syntax that allows you to write functions to read and manipulate data from any issue in Jira. Field codes are supported as well as clear text, written in quotation
UI Expand
titleParsing modes overview


ModeSupported featuresReturn typeExample
Basic
General

Field codes

Parser Functions

Status
subtletrue
titletext

The

basic parsing mode supports the usage of field codes. Field codes can be used to access issue field values

general parsing mode allows you to write functions to read and manipulate data from any issue in Jira. Field codes are supported as well as clear text.

Code Block
languagebash
titlesimple text using a field code to read the summary
linenumberstrue
This is the issue summary: %{
trigger.
issue.summary}
Advanced

Field codes

Parser Functions

Status
subtletrue
titletext


Functions as well as Field codes have to be enclosed by %{...}. When you are nesting functions, only one %{...} is necessary. Within functions, texts have to be written in quotation marks.

Code Block
languagebash
titleAdvanced expression to read the issue summary and use a function to get the assignee mail address
linenumberstrue
This is the issue summary:" + %{
trigger.
issue.summary} + " and the assignee mail is: " + userEmail(%{
trigger.
issue.assignee.email})
Math/date-time

Field codes

Parser Functions

Status
subtletrue
titlenumber
Status
subtletrue
titledate
Status
subtletrue
titledate_time

The mathematical and date time parsing mode works like the advanced mode but expect a number as result instead of a string. The resulting number is used to updated numeric or date time fields. In case of date or date time fields the number will be cast to a date.


Please be aware that the general mode always return a text. In case this is used as an input for a number (especially date) fild or as an issue list, JWT for Jira Cloud cares internally for a correct conversion.

Use mathematical operations:

Code Block
languagebash
titleTime to resolve the issue
linenumberstrue
%{{trigger.issue.resolutionDate} - {trigger.issue.createdDate}}

Working with issue lists

Code Block
languagebash
titleTime to resolve the issue
linenumberstrue
%{subtasks()}

Nested functions

Code Block
languagebash
titleTime to resolve the issue
linenumberstrue
%{count(subtasks())}


More complex example for a text which contains the current summary, the summary of the parent issue and the number of sub-tasks of the parent issue.

Code Block
languagebash
titleTime to resolve the issue
linenumberstrue
This is the issue summary: "%{issue.summary}" and that of the parent "%{parent.summary}". Issue %{parent.key} has %{count(subtasks(%{parent.key}))} sub-tasks.


An alternative expression, where the whole expression is written as one function, would be

Code Block
languagebash
titleTime to resolve the issue
linenumberstrue
{trigger.issue.resolutionDate} - {trigger.issue.createdDate
%{"This is the issue summary: \"" + %{issue.summary} + "\" and that of the parent \"" + %{parent.summary} +"\". Issue " + %{parent.key} + " has "+count(subtasks(%{parent.key})) +" sub-tasks."}


Logical

Field codes

Parser Functions

Status
subtletrue
titleboolean

The logical parsing mode

works like the advanced parsing mode but expression result must

shall return true or false. Field codes, functions and quoted texts are supported as well as comparison operators and logical connection. For details, please have a look at Logical expressions

Code Block
languagebash
titleCheck if the assignee is equals the reporter
linenumberstrue
%{
trigger.
issue.assignee} = %{
trigger.
issue.reporter}
Issue List

Field codes

Parser Functions

Statussubtletruetitleissue LISTString List

Field codes

Parser Functions

StatussubtletruetitleTEXT LISTMixed

Field codes

Parser Functions written in three curly braces

Status
subtletrue
titletext

UI Text Box
typetip

An example which uses functions and logical connectors

Code Block
languagebash
titleCheck if the assignee is equals the reporter
linenumberstrue
%{issue.issueType} = "Epic" and count(subtasks()) > 0

You can write your text in basic mode, and then switch to advanced mode using Automatic parsing mode converter.

The text to be parsed will be automatically rewritten as a string expression. Now, you can simply make the modifications you require, making use of text formatting functions, or inserting math or time expressions where needed.

To update issue fields the parsing result will be cast to the expected value e.g. a user name will be cast to a user to update a user field like the assignee field.