Math functions

Where to use

You can use math expressions to insert values into issue fields or set values of a number customfield anywhere where custom fields can be edited (create, edit & transition actions).

Math functions

In a number custom field you can use an expression to set a value:

1 + 4

This will set the field to "5"

If you want to use a math expression in another field use either of the following to insert the value:

{{#=}}1 + 4{{/}}

// more verbose but more obvious
{{#math}}1 + 4{{/}}

// increase a number by 1

Referencing other fields in calculations

You can also reference other fields.

{{#=}}3.2 * {{issue.My Number field}} + 43{{/}}

You can also reference the same field. For example, if you wanted to increase "FieldX" by 20% you can use:

{{issue.FieldX}} * 1.2

How to use math in advanced fields

You can also use this syntax in advanced fields:

  "fields": {
    "Description": "Revenue ${{#=}}{{issue.Number of customers}} * {{issue.Average sales price}}{{/}}"

For number customfields you can simple use the expression:

  "fields": {
    "Running count": "{{issue.Running count}} + 1"



We support the following operators:

Mathematical operators

Operator Description Example Example result
+ Additive operator / Unary plus 1 + 3 4
- Subtraction operator / Unary minus 4 - 3 1
* Multiplication operator 2 * 3 6
/ Division operator 6 / 4 1.5
% Remainder operator (Modulo) 5 % 3 2
^ Power Operators 2 ^ 3 8

Boolean operators

Operator Description Example Example result
= Equals 2 = 2 1
== Equals 2 == 1 0
!= Not equals 2 != 1 1
<> Not equals 2 <> 2 0
< Less than 1 < 2 1
<= Less than or equal to 1 <= 1 1
> Greater than 1 > 2 0
>= Greater than or equal to 1 >= 2 0
&& Boolean and 1 && 0 0
|| Boolean or 1 || 0 1

Note. boolean operators result always in a value of 1 or 0 (zero). Any non-zero value is treated as a true value. Boolean not is implemented by a function.


Function Description
NOT(expression) Boolean negation, 1 (means true) if the expression is not zero
IF(condition,value_if_true,value_if_false) Returns one value if the condition evaluates to true or the other if it evaluates to false
RANDOM() Produces a random number between 0 and 1
MIN(e1,e2...) Returns the smallest of the given expressions
MAX(e1,e2...) Returns the biggest of the given expressions
ABS(expression) Returns the absolute (non-negative) value of the expression
ROUND(expression,precision) Rounds a value to a certain number of digits, uses the current rounding mode
FLOOR(expression) Rounds the value down to the nearest integer
CEILING(expression) Rounds the value up to the nearest integer
LOG(expression) Returns the natural logarithm (base e) of an expression
LOG10(expression) Returns the common logarithm (base 10) of an expression
SQRT(expression) Returns the square root of an expression
SIN(expression) Returns the trigonometric sine of an angle (in degrees)
COS(expression) Returns the trigonometric cosine of an angle (in degrees)
TAN(expression) Returns the trigonometric tangents of an angle (in degrees)
ASIN(expression) Returns the angle of asin (in degrees)
ACOS(expression) Returns the angle of acos (in degrees)
ATAN(expression) Returns the angle of atan (in degrees)
SINH(expression) Returns the hyperbolic sine of a value
COSH(expression) Returns the hyperbolic cosine of a value
TANH(expression) Returns the hyperbolic tangents of a value
RAD(expression) Converts an angle measured in degrees to an approximately equivalent angle measured in radians
DEG(expression) Converts an angle measured in radians to an approximately equivalent angle measured in degrees

Note. Functions names are case insensitive.


Constant Description
e The value of e, exact to 70 digits
PI The value of PI, exact to 100 digits
TRUE The value one
FALSE The value zero
NULL The null value