You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I have an automation that does division calculations. I get division by zero error even though I exactly do a check beforehand:
What could the issue be?
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.
Also I noticed in my automation that in some places the if conditions trigger correctly
And in others they do not:
The hotfix seems to be using the inline notation as this at least avoids that there is a division by zero error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the suggestion, unfortunately it does not really help as this is the output I am getting:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.