Hi all,
I have an automation to calculate as below :
{{#=}} {{issue.customfield_1299|0}} + {{issue.customfield_1280|0}}{{/}}
but the outcome always just show the result of customfield_1299 instead of actually adding or subtracting from customfield_1280.
When I tried like this : {{issue.customfield_1299|0}} + {{issue.customfield_1280|0}}
it will show something like this : 6 + 0
so customfield_1280 doesnt represent any value unfortunately. Can anyone help me on this please?
Hi @nasiruddin_nordin ,
If we use the following, we will get an error instead of zero when both fields are EMPTY as noted in a similar community article here:
{{#=}}
{{issue.customfield_13400}} + {{issue.customfield_13401}}
{{/}}
I think that's why you resort to using a "|0" to avoid an EMPTY value:
{{#=}} {{issue.customfield_1299|0}} + {{issue.customfield_1280|0}}{{/}}
But I think the above may result in text values inside {{#=}}, and I don't know how A4J handles it. Thus, I think we got unexpected results.
Here my solution, using the IF mathematical expression - IF(condition,value_if_true,value_if_false) instead of using {{field|0}}.
{{#=}}
{{IF(issue.customfield_13400,issue.customfield_13400,0)}}
+ {{IF(issue.customfield_13401,issue.customfield_13401,0)}}
{{/}}
The above works, because the mathematical IF(,,0) always returns a true numeric zero.
Context is important for automation rule questions. 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...
You note both fields are number types. Have you confirmed that?
Have you confirmed the custom field id values you are using? For example, by writing those individual smart values to the audit log to confirm they contain what you expected?
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 @nasiruddin.nordin
Try using below smart values for addition
{{#=}} {{issue.customfield_1299.plus(issue.customfield_1280)}}{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tried to do like this as well :
{{issue.customfield_10299}} + {{issue.customfield_10280}}
and the result i got was 4.0+
It does not detect the customfield_10280.
I have checked the type of everyfield and it is number fields so by right it should work :(
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.