Texts

The JWT expression parser is very powerful when it come to composing texts.

This page contains a comprehensive overview of all related information.

Fixed values

  • When used inside the function mode (%{...}), texts need to be written in double quotes, e.g., "This is a text"

  • Operator + is used for concatenating texts. e.g., "This is" + " a text." = "This is a text." .

  • The Escape character is "\" . This character can precede any of the following characters: ", \, n, r, t, f and b in order to invoke an alternative interpretation. e.g. \n for a linefeed.

If you want to introduce a double quote in a text expression you should precede it with escape character as in "The man said: \"Hello!\".", where we are using the escape character\to write the text Hello! in double quotes.

Variable values (field values)

Text field values can be inserted into expressions using field codes in the format %{...somefield}, or %{...somefield.i} for referencing concrete levels in cascading select fields (i = 0 for base level).

Pro tip

For checking if a field has a value you can use %{...somefield} = null or %{...somefield} != null.

For a concrete level in a Cascading Select or Multi-Cascading Select field, you should use %{...somefield.i} = null or %{...somefield.i} != null.

Any field type has a text value, so you can also use%{...somefield} to insert text values of fields of type Number (which includes Date and Date-Time values). Read more about Data types (JWT expressions).

📚 Examples

Input

Output

%{"Hello" + " " + "world" + "."}

Hello world.

%{trim(%{issue.summary})}

Summary of an issue without leading and trailing blanks

%{issue.description} \nLAST USER: %{toUpperCase(%{system.currentUser})}

Description of an issue and a new line with string "LAST USER: " and the name of current user  in upper case.

Available functions

Function Short description Output
findReplaceAllIgnoreCase()

Replaces all occurrences of a given text with a given replacement, ignoring the case.

text

jiraExpression()

Returns the result of a Jira expression.

text  

findReplaceFirstIgnoreCase()

Replaces the first occurrence of a given text with the given replacement, ignoring the case.

text

getFromJSON()

Returns the result of a given JMESPath which is applied to a JSON

text  

findPatternIgnoreCase()

Returns all substrings matching a given regular expression, ignoring the case.

text list

findReplaceAll()

Replaces all occurrences of a given text with the given replacement.

text

project()

Returns the key of the project with a given ID.

text

replaceAll()

Replaces all substrings matching a regular expression with a given replacement.

text

toUpperCase()

Converts a given text with all characters to upper case.

text

length()

Returns the length any given text.

number

matches()

Checks, if the given text matches the given regular expression.

boolean

issueType()

Returns the name of the issue type with a given ID.

text

resolution()

Returns the name of the resolution with a given ID.

text

substring()

Returns a specific part of a text.

text

trim()

Removes leading and trailing blanks (white spaces and tabs) from a text.

text

findPattern()

Returns all substrings matching a given regular expression.

text list

toLowerCase()

Converts a given text with all its characters to lower case.

text

status()

Returns a status name.

text

findReplaceFirst()

Replaces the first occurrence of a given text with the given replacement.

text

replaceFirst()

Replaces the first substring matching a given regular expression with a given replacement.

text