Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Table of Contents

How 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).

Image Removed

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

Code Block
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:

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


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

Referencing other fields in calculations

You can also reference other fields.

Code Block
{{#=}}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:

Code Block
{{issue.FieldX}} * 1.2

How to use math in advanced fields

You can also use this syntax in advanced fields:

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

For number customfields you can simple use the expression:

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

Reference

Operators

We support the following operators:

...

1 && 1
1 && 0
0 && 0

...

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.

Functions

...

Note. Functions names are case insensitive.

Constants

...

Info

Our documentation has recently move to a new location! Please head on over to: http://docs.codebarrel.io/automation/#/smart-fields/math-functions