syntax on how to check automation  variable's value to zero

Lopes_ Bonnie
Contributor
March 5, 2025

Looking for syntax on how to check automation  variable's value to zero.

I later divide by this variable varTotalCountSmart, so need to add a condition before the math function to not execute the create variable varEpicCompletion if varTotalCountSmart is equal to 0

 

variable.PNG

calculation

epic completion.PNG

 

varTotalCountSmart

 

varTotalCountSmart

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 5, 2025

Hi @Lopes_ Bonnie 

Without seeing your entire rule, what do you want to happen when the total count is 0?

 

Let's assume you want the varEpicCompletion to be 0 also.

There are several ways to handle this, and the simplest is to use an inline condition to substitute a value when it is 0, such as 1.  This could be done in either variable because if the total count is 0, the done count is also likely 0; thus 0 / 1 = 0.

  • action: create variable
    • name: varEpicCompletion
    • value:
{{#=}} FLOOR( {{varDoneCount}} / {{if(varTotalCount.asNumber.gt(0), varTotalCount, 1)}} * 100) {{/}}

 

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events