Syntax
Only two values will be accepted / returned: true
and false
.
Logical operators
The following logical operators can be used for linking logical terms in an expression, i.e., terms that return a boolean value type (true or false).
Operator | Meaning | Precedence |
---|---|---|
NOT or ! | logical negation | 1 (highest) |
AND or & | logical conjunction | 2 |
OR or | | logical disjunction | 3 |
XOR | exclusive or, i.e., a XOR b is equivalent to a AND !b OR !a AND b | 3 |
IMPLIES or IMP | logical implication, i.e., a IMPLIES b is equivalent to !a OR b | 4 |
XNOR or EQV | logical equivalence, i.e., a EQV b is equivalent to a IMPLIES b AND b IMPLIES a | 4 (lowest) |
Logical connectives are case insensitive, i.e., they can also be written in lower case: or
, and
, not
, xor
, implies
, imp
, eqv
and xnor
.
Conditional operator: ? :
(IF, THEN, ELSE)
The conditional operator ? :
is a powerful operator to construct conditional expressions.
- Format: <boolean_expression> ? <term_1> : <term_2>
where <term_1> and <term_2> are terminus of the same type (boolean, number, string, issue list, string list or number list).
Examples of using the conditional operator
Expression | Output |
---|---|
{...duedate} != null ? ({...duedate} - {...currentDateTime}) / {HOUR} : 0 | If the Due Date is not null , this function will return the number of hours from the current date-time to Due Date, otherwise it will return 0 . |
timePart({...currentDateTime}, LOCAL) > 21:00 AND timePart({...currentDateTime}, LOCAL) < 7:00 ? "Night" : "Day" | If the current time is between 21:00 and 7:00 this function will return "Night" , otherwise it will return "Day" . |