I’m using mathematical expressions to calculate a bunch of custom fields in a sequential order in one automation rule
i.e to calculate the VAT field I’m using the following:
{{#=}} {{issue.Rent Amount}} * .15 {{/}}
then I’m using the output to calculate the total amount:
{{#=}} {{issue.Rent Amount}} + {{issue.VAT}} + {{issue.Other fees}} {{/}}
the problem is that sometimes the total amount doesn’t add the VAT
My assumption is that there is some lag in filling the VAT field and by the time the automation runs the second line (Total amount), the VAT is still null.
any recommendations on how to avoid this or if there is a better way to do these calculations?
much appreciated
Hi @yousefq,
Try to add the action Re-fetch issue data before calculation of the total amount. It refreshes smart values with the latest field values.
The other solution is to calculate all at once:
{{#=}} {{issue.Rent Amount}} + ({{issue.Rent Amount}} * .15) + {{issue.Other fees}} {{/}}
Hi @yousefq
Adding to the answer from @Kseniia Trushnikova ...the Re-fetch Issue action is helpful in this scenario, and it can slow down the rule by about 1 second per call. (Which makes it helpful for other things too.)
When you have multiple, sequential and dependent calculations, using Re-fetch repeatedly could slow a rule down so much that it causes service limit problems. For that case, it can be better to calculate your intermediate values and store them in Created Variables, use those in the math operations, and then update the issue once using the variables' values.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.