Status | |
---|---|
Tech review | TODO |
Style guide | TODO |
TODO
READY FOR REVIEW
DONE
FLAGGED
On this page
Overview
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 and their meaning are listed below - the applicable data types for the elements (operands) of the respective operators can be found in the subsequent table.
A comparison always returns a BOOLEAN value.
All operators respect the case of the characters.
Operator | Meaning | Examples (all examples return true ) |
---|---|---|
= | equal to | 1=1 true = true [1, 2, 3] = [1, 2, 3] ["blue", "red", "green"] = ["blue", "red", "green"] When working with lists, each elements' existence and its order are being evaluated. |
!= | not equal to |
When working with lists, each elements' existence and its order are evaluated. |
< | lower than |
|
> | greater than |
|
<= | less than or equal to |
|
>= | greater than or equal to |
|
~ | contains |
|
!~ | does not contain |
|
in | is contained in | "world" in "Hello world!" , to check whether a substring is contained in a string. %{system.currentUser} in %{issue.components.leads} , checks whether "Current user" is contained in "Component leads". [1, 1, 2] in [2, 1, 1, 1, 4] , cardinalities of every single element must match. ["blue", "red", "red"] in ["red", "green", "blue", "red", "red"] , cardinalities of every single instance of an element must match. 2 in [1, 2, 3] "blue" in ["red, "blue", "white"] |
not in | is not contained in | "Hello world!" not in "world" %{issue.versions} not in %{issue.fixVersions} , checks whether not all versions in "Affects version/s" are contained in "Fix version/s". [1, 1, 2, 2] not in [2, 1, 1, 1, 4] , cardinalities of every single element must match. ["blue", "red", "red", "blue"] not in ["red", "blue", "red", "red"] , cardinalities of every single instance of an element must match. 5 not in [1, 2, 3, 3, 4] "orange" not in ["blue", "red", "white"] |
any in | some element is in | %{issue.versions} any in %{issue.fixVersions} , checks whether any version in "Affects version/s" is contained in "Fix version/s". [1, 3] any in [3, 4, 5] ["blue", "white"] any in ["black", "white", "green"] |
none in | no single element is in | %{issue.versions} none in %{issue.fixVersions} , checks whether there isn't a single version "Affects version/s" in "Fix version/s". [1, 2] none in [3, 4, 5] ["blue", "red"] none in ["black", "white", "green"] |
The following comparison operators are applicable to STRING and STRING LIST data types.
All operators ignore the case of the characters.
Operator | Meaning | Examples (all examples return true ) |
---|---|---|
=~
| equal to |
"HELLO" =~ "Hello"
"up" =~ "UP"
["blue", "red", "green"] =~ ["Blue", "RED", "Green"]
|
!=~
| not equal to |
" HELLO" !=~ "Hello"
"up" !=~ "down"
("up" !=~ "UP") = false
["blue", "red"] !=~ ["Blue", "green"]
["blue", "red"] !=~ ["Red", "BLUE"]
(["blue", "red", "green"] !=~ ["Blue", "RED", "Green"]) = false
|
~~
| contains |
"Hello World!" ~~ "world"
, checks whether a string contains a substring.
"A small step for a man" ~~ "STEP"
, checks whether a string contains a substring.
["one", "two", "three"] ~~ ["TWO", "One"]
, checks whether a string list contains all the elements of another string list. |
!~~
| does not contain |
"Hello World!" !~~ "bye"
, checks whether a string doesn't contain a substring.
"A small step for a man" !~~ "big"
, checks whether a string doesn't contain a substring.
["one", "two", "three"] !~~ ["Four"]
, checks whether a string list doesn't contain one element of another string list.
(["one", "two", "three"] !~~ ["TWO"]) = false
|
in~
| is contained in |
"world" in~ "Hello World!"
, checks whether a substring is contained in another string.
"STEP" in~ "A small step for a man"
, checks whether a substring is contained in another string.
["TWO", "One"] in~ ["one", "two", "three"]
, checks whether all the elements of a string list are contained in another string list. |
not in~
| is not contained in |
"bye" not in~ "Hello World!"
, checks whether a substring is not contained in another string.
"big" not in~ "A small step for a man"
, checks whether a substring is not contained in another string.
["Four"] not in~ ["one", "two", "three"]
, checks whether any of the elements of a string list are not contained in another string list.
(["TWO"] not in~ ["one", "two", "three"]) = false
|
any in~
| some element is in |
["blue", "violet"] any in~ ["Blue", "Red", "Green"]
["Five", "One"] any in~ ["FOUR", "FIVE", "SIX"]
|
none in~
| no single element is in |
["Orange"] any in~ ["red", "blue", "green"]
(["orange"] any in~ ["Red", "Orange"]) = false |
Below you find a comprehensive matrix of all operators and applicable data types.
Comparison Operator | BOOLEAN | NUMBER | TEXT | NUMBER LIST | TEXT LIST | ISSUE LIST | MULTI-VALUE FIELD |
---|---|---|---|---|---|---|---|
=
| X | X | X | X | X | X | X |
!=
| X | X | X | X | X | X | X |
<
| - | X | X | - | - | - | - |
>
| - | X | X | - | - | - | - |
<=
| - | X | X | - | - | - | - |
>=
| - | X | X | - | - | - | - |
~
| - | - | X | X | X | X | X |
!~
| - | - | X | X | X | X | X |
in
| - | - | X | X | X | X | X |
not in
| - | - | X | X | X | X | X |
any in
| - | - | - | X | X | X | X |
none in
| - | - | - | X | X | X | X |
=~
| - | - | X | - | X | - | - |
!=~
| - | - | X | - | X | - | - |
~~
| - | - | X | - | X | - | - |
!~~
| - | - | X | - | X | - | - |
in~
| - | - | X | - | X | - | - |
not in~
| - | - | X | - | X | - | - |
any in~
| - | - | - | - | X | - | - |
none in~
| - | - | - | - | X | - | - |
Logical operators
The table below lists all logical operators that can be used for linking logical terms in an expression.