You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

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.



Available parsing modes


There are two parsing modes available in the expression parser:

  • General: you can write free text, 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 expression mode as a parsing mode in every context.

Parsing 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:   %{  →  \%\{

TEXT

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.

simple text using a field code to read the summary
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).

Advanced expression to read the issue summary and use a function to get the assignee mail address
%{"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:: Time to resolve the issue
%{{trigger.issue.resolutionDate} - {trigger.issue.createdDate}}
Working with issue lists: Getting the sub-tasks of an issue
%{subtasks()}
Nesting functions: Getting the number of the sub-tasks of an issue
%{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.
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
%{"This is the issue summary: \"" + %{issue.summary} + "\" and that of the parent \"" + %{parent.summary} +"\". Issue " + %{parent.key} + " has "+count(subtasks(%{parent.key})) +" sub-tasks."}

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