Versions Compared

Key

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


Excerpt


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 two parsing modes available in the expression parser:

General: you can write freetext, insert field codes or use functions anywhere in your text. Field codes will be replaced at runtime with the corresponding field values of the issue currently being processed. Using 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.

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 Removed

.


Image Added



Available parsing modes

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


Comments

The 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.

UI Text Box
typetip

Most functions will accept text values so casting values to text is a very powerful function

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

UI Expand
titleParsing modes overview
ModeSupported featuresReturn typeExample
General

Field codes

Parser Functions

Text  with the following restriction: the following combination  of characters has to be escaped by "\" when not being used as a field code field codes:   %{  →  \%\{

Status
subtletrue
titletext

Code Block
languagebash
titlesimple text using a field code to read the summary
linenumberstrue
This is the issue summary: %{issue.summary}
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. Quotes (") within a quoted text have to be escaped (e.g. "This is a \"quoted\" text" will result in This is a "quoted" text).
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: " + %{issue.summary} + " and the assignee mail is: " + userEmail(%{issue.assignee.email})

Please be aware that the general mode always return a text. In case this is used as an input for a number (especially date) parameter 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 entire expression is written as one function, would be
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."}
UI Text Box
typetip

The following combination  of characters has to be escaped by "\" when not being used as a field code or function delimiter:   %{  →  \%\{

Logical

Field codes

Parser Functions

Status
subtletrue
titleboolean

The logical parsing mode 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
%{issue.assignee} = %{issue.reporter}

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
info

Comments can be added to all parsing modes. They serve as internal documentation for the expression and are ignored when evaluating the expression.


Parsing modeSyntaxExamples
General

Only available when using expressions enclosed by %{}.

Starts with # and ends either at the end of the line or if the expression is closed by }


Code Block
List of issue keys for %{issue.key #choose an issue} is:
%{subtasks() # and show all sub-tasks}


Code Block
%{# This example simply returns the number of linked issues using a JWT expression
 
%{issue.links.length}}


LogicalIt starts with # and ends at the end of the line


Code Block
%{issue.key} = "PRJ-42" # simple comparison with issue key


Code Block
# This example simply returns the number of linked issues using a JWT expression
 
%{issue.links.length}


Jira expressionIt starts with // and ends with the end of the line


Code Block
issue.key == 'PRJ-42' // simple comparison with issue key





Excerpt Include
DECADIS:Contact support
DECADIS:Contact support
nopaneltrue