Going Stellar

Home/Smart values reference

Jira Automation smart value

Math expressions in Jira Automation: syntax and examples

A math expression sits between {{#=}} and {{/}} and returns a number. Use it for totals, percentages, rounding and simple if/else choices, and combine it with other smart values that return numbers, such as a text length or a list size.

Syntax

{{#=}}expression{{/}}
{{#=}}{{issue.comments.size}} + {{issue.labels.size}}{{/}}

Arguments

ArgumentWhat it isRequired
expressionNumbers, operators, functions such as MIN, MAX, ABS, ROUND, FLOOR, CEILING, SQRT, IF and NOT, and smart values that return numbersyes

Works on

  • Operators: + - * / % ^ and the comparison and boolean operators = == != <> < <= > >= && ||
  • Returns: a number; comparisons and boolean operators return 1 or 0

Examples

{{#=}}{{issue.comments.size}} + {{issue.labels.size}}{{/}}

Add two list sizes to get one activity number for a Slack line.

Result:

4

Run on Jira Cloud on .

{{#=}}ROUND({{issue.summary.length()}} / 5, 1){{/}}

Divide the length of a summary by 5 and keep one decimal, which a plain divide() on whole numbers cannot do.

Result:

2.4

Run on Jira Cloud on .

{{#=}}IF({{issue.comments.size}} > 1, {{issue.comments.size}} * 10, 0){{/}}

Pick one of two numbers from a comparison, for example a score that only counts once a thread has more than one comment.

Result:

20

Run on Jira Cloud on .

{{#=}}MAX({{issue.comments.size}}, {{issue.labels.size}}){{/}}

Take the larger of two counts.

Result:

2

Run on Jira Cloud on .

{{#=}}6 / 4{{/}}

Division inside an expression keeps the decimals.

Result:

1.5

Run on Jira Cloud on .

{{#=}}1 || 0{{/}}

Boolean operators return 1 or 0, so they can feed IF() or be printed as a flag.

Result:

1

Run on Jira Cloud on .

Where the documentation differs

  • {{#=}}PI{{/}}

    Run on Jira Cloud, : the documentation says The docs say PI is precise to 100 digits., the actual result is 3.141592653589793.

Pitfalls

  • A number field without a value leaves the operator with nothing on its left. {{#=}}{{issue.Invoice Amount}} * 1.2{{/}} on an empty field fails at run time with "Unknown unary operator * at character position 1: * 1.2" and the rule stops, while + 100 on the same empty field gives 100 (checked on Jira Cloud, November 2026).
  • Comparison and boolean operators give 1 or 0 inside {{#=}}, but the comparison functions such as gt() give true or false as text. Do not mix the two in one condition.
  • {{#=}}PI{{/}} prints 3.141592653589793, not the 100 digits the docs mention (checked on Jira Cloud, November 2026).
  • Whole numbers divided with divide() lose the decimals, so a share such as 12 / 5 needs an expression to stay 2.4.

Sources

  1. Jira smart values: math expressions (Atlassian Support)

Markdown version · All smart values