Hi everyone!
I want to create an automatic rule for the following custom fields: aaa, bbb, ccc, ddd, eee, fff, ggg, hhh, iii, jjj).
The formula I would like to apply is as follows:
(aaa*bbb)+(ccc*ddd)+(eee*fff)+(ggg*hh)+(iii*jj).
My rule works for the first two elements: (aaa*bbb)+(ccc*ddd)
But it doesn't work if I include the remaining part.
{{#=}}{{issue.aaa}} * {{issue.bbb}}+{issue.ccc} * {{issue.ddd}}+{{issue.eee}} * {{issue.fff}}+{issue.ggg}} * {{issue.hhh}}+{issue.iii}} * {{issue.jjj}}{/}}
What is wrong with this formula?
Thank you in advance.
@Sara Valoti SK maybe you should try with parentheses ()
{{#=}} ({{issue.aaa}} * {{issue.bbb}}) +({{issue.ccc}}* {{issue.ddd}}) + .....{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!
Until we see those...
What do you observe happening that leads you to believe the formula is not working?
What are the types of your fields: text, number, selection, etc.? The types of the fields will impact how they are referenced / used in math operations.
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.
Hi @Bill Sheboy,
after careful verification, I can say that my formula works once yes and once no.
I will describe the specific situation so that I can clarify the problems I am facing.
The formula I would like to make work is as follows:
{{#=}}{{issue.Quantity First Item}} * {{issue.CAD Price First Item}}
+{{issue.Quantity Second Item}} * {{issue.CAD Price Second Item}}
+{{issue.Quantity Third Item}} * {{issue.CAD Price Third Item}}
+{{issue.Quantity Fourth Item}} * {{issue.CAD Price Fourth Item}}
+{{issue.Quantity Fifth Item}} * {{issue.CAD Price Fifth Item}}{/}}
Sometimes it works, sometimes it doesn't. What could be the problem?
See the attached screenshots.
I hope they are helpful!
Thank you in advance for your time and help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for that information, and...
When you describe it does not work consistently, have you checked the following:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. Field to monitor changes: some words are lowercase (in Edit Field expression everything is uppercase)
2. I have tested your expression (it works). The only case when it doesn't work is when one or more number fields are empty. So each number field needs to have Value (you can set default value for custom field: 0)
3. Since you create variable with math expression during your automation, there is no need to repeat expression in edit field action. The value in edit field action can be: {{TOTALEpreventivo}} but it will work your way either (it's just redundant).
Also, in your expression, instead of using {{issue.Quantità primo articolo}} you can use {{issue.customfield_xxxxx}} where xxxxx is the ID of your custom field. (This would possibly solve the problem with lowercase, uppercase and letters like À.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stevan!
Exactly, it was just as you indicated: it was not working because while I was testing, not all the fields were complete. I then set as default values “0” so I did not encounter any more problems.
Thanks also for the clarification of the redundancy (in fact it seemed strange to me that I had to repeat the formula such and such also in the second field)
Thanks again for the support.
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.