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

Compare with Current View Page History

« Previous Version 15 Next »

Logical expression in JWT Cloud are built the same as in JWT DC. However, besides the general differences concerning field codes (see Migrate field codes) and parser functions (see Migrate JWT expression parser functions) there are also slight differences in the logical parsing mode. They are explained below.


Multi-valued fields

In JWT DC so-called multi-valued fields are treated as lists (and not as simple text) when using the following logical operators :

Operator
JWT DC

Meaning
~contains
!~does not contain
in is contained in
not in is not contained in
any inany element is in
none inno single element is in
~~contains  (case ignoring)
!~~does not contain  (case ignoring)
in~is contained in (case ignoring)
not in~is not contained in  (case ignoring)
any in~any element is in (case ignoring)
none in~no single element is in (case ignoring)


That means that in JWT DC it is possible to write expressions like 

%{issue.components} any in %{parent.components}

In JWT Cloud, this notion is not available. An expression dealing with such a multi-valued field has to be migrated by explicitely converting the field code value using the function toStringList (or toNumberList, respectively).

The following fields are considered multi-valued fields:


Migration of multi-valued fields in logical expressions: Apply the function toStringList() to the respective field.

Examples

JWT DC

expression

JWT CLoud 

expression

%{issue.versions} none in %{issue.fixVersions}
toStringList(%{issue.versions}) none in toStringList(%{issue.fixVersions})
 %{issue.labels} any in ["Backend", "Frontend"] 



toStringList(%{issue.labels}) any in ["Backend", "Frontend"]
Case ignoring operators

In JWT DC, some case-ignoring operators are available (for details please see the respective part in the description of JWT DC's Logical mode). They are not  available in JWT CLoud.

Operator
JWT DC

Meaning
=~equal to

!=~

not equal to
~~contains
!~~does not contain
in~is contained in
not in~is not contained in
any in~any element is in
none in~no single element is in


As a work around you can use the functions toUpperCase()/toLowerCase() for both operands and use the respective case sensitive operator. If  an operand is a List, it first has to be converted to a text first using toString().

Examples

JWT DC

expression

JWT Cloud expression
"HELLO" =~ "Hello"
toUpperCase("HELLO") = toUpperCase("Hello")
%{issue.labels} ~~ ["Backend","Database"]
toStringList(toLowerCase(%issue.labels})) ~ toStringList(toLowerCase(toString(["Backend","Database"])))

In this case we are dealing with a multi-valued field and thus have to convert it to a text list using toStringList() before comparing.




If you still have questions, feel free to refer to our support team.