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?
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
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:
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.
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.
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.
It looks like you're new here. Sign in or register to get started.