The JWT expression parser accepts the most common comparison operators as well as logical operators .
The main purpose of these operators is to construct complex logical comparisons by linking individual expressions.
Comparison operators
The operators, their meaning and the applicable data types you can use them with are listed below.
A comparison always returns a boolean value.
Overview of all case-sensitive comparison operators
All operators respect the case of the characters.
|
Operator |
Meaning |
Examples (all examples return |
|---|---|---|
|
|
equal to |
Bash
When working with Lists, each elements' existence and its order are being evaluated. |
|
|
not equal to |
Bash
When working with Lists, each elements' existence and its order are being evaluated. |
|
|
less than |
Bash
|
|
|
greater than |
Bash
|
|
|
less than or equal to |
Bash
|
|
|
greater than or equal to |
Bash
|
|
|
contains |
Bash
|
|
|
does not contain |
Bash
|
|
|
is contained in |
Bash
|
|
|
is not contained in |
Bash
|
|
|
any element is in |
Bash
|
|
|
no single element is in |
Bash
|
When comparing lists, the exact number of occurence (cardinality) per element must match.
|
Parser expression |
Output |
Description |
|---|---|---|
|
Bash
|
|
This expression returns |
|
Bash
|
|
This expression returns appear twice in the first list. |
Overview of all case ignoring comparison operators
The following comparison operators can be used with text and text list data types .
All operators ignore the case of the characters.
|
Operator |
Meaning |
Examples (all examples return |
|---|---|---|
|
|
equal to |
Bash
|
|
|
not equal to |
Bash
|
|
|
contains |
Bash
|
|
|
does not contain |
Bash
|
|
|
is contained in |
Bash
|
|
|
is not contained in |
Bash
|
|
|
any element is in |
Bash
|
|
|
no single element is in |
Bash
|
Applicable data types
Below you find a comprehensive matrix of all operators and applicable data types .
|
Comparison Operator |
BOOLEAN |
number |
Text |
number list |
text list |
issue list |
|---|---|---|---|---|---|---|
|
|
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
|
|
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
|
|
- |
✅ |
✅ |
- |
- |
- |
|
|
- |
✅ |
✅ |
- |
- |
- |
|
|
- |
✅ |
✅ |
- |
- |
- |
|
|
- |
✅ |
✅ |
- |
- |
- |
|
|
- |
- |
✅ |
✅ |
✅ |
✅ |
|
|
- |
- |
✅ |
✅ |
✅ |
✅ |
|
|
- |
- |
✅ |
✅ |
✅ |
✅ |
|
|
- |
- |
✅ |
✅ |
✅ |
✅ |
|
|
- |
- |
- |
✅ |
✅ |
✅ |
|
|
- |
- |
- |
✅ |
✅ |
✅ |
|
|
- |
- |
✅ |
- |
✅ |
- |
|
|
- |
- |
✅ |
- |
✅ |
- |
|
|
- |
- |
✅ |
- |
✅ |
- |
|
|
- |
- |
✅ |
- |
✅ |
- |
|
|
- |
- |
✅ |
- |
✅ |
- |
|
|
- |
- |
✅ |
- |
✅ |
- |
|
|
- |
- |
- |
- |
✅ |
- |
|
|
- |
- |
- |
- |
✅ |
- |
Please be aware the both operands of the respective comparison must have the same data type. The only exceptions are the following:
-
Automatic casting from number to text : Whenever you write a numeric term at the right-hand side of a comparison operator like =, and the left-hand side is occupied by a text term, the parser will automatically transform the right-hand side term into a text (e.g. "30" = 30 will be interpreted the same way as "30" = "30")
-
Single values as operand in list operations: Operators
~, !~, inandnot incan be used for checking a single element ( number or text ) against a number list or a text list -
Comparison with the null value: A field which is not set or an empty text is interpreted as null. A number field, which doesn't contain a number, is also interpreted as
null.
Things to remember
|
Remember |
Examples |
|---|---|
|
Operators |
Bash
|
|
Operators |
Bash
|
|
Operators |
Bash
|
|
Operators |
Bash
|
|
Operators |
Bash
|
Logical operators
The table below lists all logical operators that can be used for linking logical terms in an expression.
Logical operators take logical terms (which return boolean values) as operands and can thus be built using:
-
a boolean value
-
a JWT expression parser function returning a boolean value
-
a comparison
-
a logical term enclosed by brackets ()
-
two logical terms connected with a logical operator, where boolean literals and comparisons themselves are logical terms.
Logical operators can only be used in logical expressions in the Logical mode or in combination with the conditional operator.
Overview of all logical operators
|
Operator |
Meaning |
Precedence |
|---|---|---|
|
|
logical negation |
1 (highest) |
|
|
logical conjunction |
2 |
|
|
logical disjunction |
3 |
|
|
exclusive or, i.e., |
3 |
|
|
logical implication, i.e., |
4 |
|
|
logical equivalence, i.e., |
4 (lowest) |
A single logical term can be enclosed by brackets () in order to increase the readability of the expressions or to define a precedence which differs from the given one.
Logical operators can also be written in lower case (e.g. and , or )
Conditional operator
The conditional operator ? : is a powerful operator to construct conditional expressions.
It basically allows you to construct the following expression: IF logical_expression true THEN term_1 ELSE term_2.
<logical_expression> ? <term_1> : <term_2>
The conditional operator is extremely helpful when being used in calculated fields.
Examples of using the conditional operator
|
Expression |
Description |
|---|---|
|
IF the priority of an issue is Blocker, THEN this function will return "Please have a look at this issue immediately" ELSE it will return "No stress, come back later". |
|
IF an issue does have a due date set (due date is not null), THEN this function will return the number of hours from the current date-time to the due date ELSE it will return |
|
IF a custom field (e.g. a select list) has a value of Red, THEN this function will return "Color", ELSE it will return "No color". |
|
IF the current time is between 21:00 and 7:00 THEN this function will return "Night" , ELSE it will return "Day". |
List operators
| Function | Short description | Output |
|---|---|---|
| UNION |
Returns distinct elements of two lists. |
LIST |
| INTERSECT |
Returns common elements of two lists. |
LIST |
| EXCEPT |
Removes certain elements from a list. |
LIST |
| APPEND |
Combines the elements of two lists. |
LIST |
Order of operations
If you use multiple operators in a single expression, they will follow a certain order in which they are processed or a precedence.
-
When using the list operators, you have to make sure that both lists that you compare are of the same type.
-
All operators are case insensitive, i.e., they can also be written in lower case:
append,union,intersectandexcept. -
There are four equivalent functions available for each type of list, and their behavior is exactly equivalent to that of its corresponding operator.
-
This way, you can choose to use operators or functions according to your preference. Although operators yield shorter expressions and with fewer parentheses, the usage of functions produces a more functional consistent syntax.