Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Division by zero error even though 0 check is done

I have an automation that does division calculations. I get division by zero error even though I exactly do a check beforehand:

Screenshot 2023-10-10 172100.png

 

What could the issue be?

2 answers

1 accepted

0 votes
Answer accepted
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.
Oct 10, 2023

Hi @Hannes Kuchelmeister 

I have not seen that expression syntax before for math operations for smart values...and, I note you have some extra spaces in your expression around the smart values.

Perhaps try this instead:

{{#=}}ROUND((1 - {{estimatedSubIssues}} / {{totalSubIssues}} ), 2){{/}}

Or for the inline version:

{{estimatedSubIssues.asNumber.divide(totalSubIssues.asNumber).multiply(-1).plus(1).format("###.##")}}

Please note these both produce text expressions due to the use of ROUND or format.

Kind regards,
Bill

Hi Bill,

 

thanks for  the suggestion. For some reason only the inline version seems to work. This is quite peculiar to me.

If block conditions spooky

Also I noticed in my automation that in some places the if conditions trigger correctly

Screenshot 2023-10-11 091116.pngScreenshot 2023-10-11 091325.png

And in others they do not:

Screenshot 2023-10-11 091726.pngScreenshot 2023-10-11 091807.png

Inline notation avoids division by zero

The hotfix seems to be using the inline notation as this at least avoids that there is a division by zero error.

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.
Oct 11, 2023

Please do not add spaces around the field names and the curly brackets, as that may lead to syntax errors.  Use this {{totalSubIssues}} and not this {{ totalSubIssues }}

Next thing: your rule appears to be processing multiple issues, based on the audit log.  I wonder if you are misunderstanding how variables work in that context, and so the rule may not be doing what you think.  Variables do not persist over branches or multiple issue processing for things like the scheduled trigger.

To confirm what your rule is actually doing, please post an image of your entire rule, in one image, and an image of the complete audit log details showing a full rule execution.

If you question has already been answered, please disregard this request.

Hi Bill,

the rule seems to work now correctly, however, I'd value if you could take a quick look at the rule. My intention is to update every epic based on the Stories and Tasks that it contains.

Full run.pngfull_rule.png

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.
Oct 12, 2023

I am glad to learn it is working now.

Looking at your rule, I wonder if some of the conditions/logic can be simplified...

When checking a numeric expression (such as creating your variables), you can add a default value in cases where the result may be empty (i.e., null).  For example with this...

{{lookupIssues.size|0}}

Will always return at least a 0 value, and that can help simplify conditions, and prevent errors when a null value could break a math operation.

2 votes
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 10, 2023

I would recommend that you add a log action step in your automation that logs the values of {{estimatedSubIssues}} and {{totalSubIssues}, that way you can check what their values are and then go from there.

Thanks for the suggestion, unfortunately it does not really help as this is the output I am getting:

Screenshot 2023-10-11 085428.png

Suggest an answer

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

Atlassian Community Events