I can't figure out why this isn't working with the IF. According to the online docs, equals returns a true or false but the {{math}} smart-value IF condition isn't accepting it.
{{#math}}
IF({{equals(issue.Advisement Type,"Post Production Gap Analysis")}},40,0)
+ IF({{equals(issue.Advisement Type,"Content changes")}},40,0)
{{/}}
"Advisement Type" is a custom bullet selection list.
The error I'm getting is:
Error rendering smart-values when executing this rule:
For whatever reason, there is no string comparison support in the `{{math}}` function. So I solved this with a brute force method to turn the result into a numeric comparison.
{{#math}}
IF({{issue.Advisement Type.value.indexOf("Post Production Gap Analysis")|-1}}>=0,40,0)
+ IF({{issue.Advisement Type.value.indexOf("Conceptual Review")|-1}}>=0,40,0)
{{/}}
Hi @Leeland
That looks like your custom field is collapsing to null, and taking the equals() test with it.
Have you tried adding a .value to the end of your field to confirm a value is being used?
{{#math}}
IF({{equals(issue.Advisement Type.value,"Post Production Gap Analysis")}},40,0)
+ IF({{equals(issue.Advisement Type.value,"Content changes")}},40,0)
{{/}}
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Bill Sheboy,
I tried that and it didn't work. But the documentation is light for the single list select access. I didn't know about the ".value" for that. Prior attempts showed that the join() and indexOf() method didn't work. But, using .value the indexOf worked. So I solved this with the brute force method.
{{#math}}
IF({{issue.Advisement Type.value.indexOf("Post Production Gap Analysis")|-1}}>=0,40,0)
+ IF({{issue.Advisement Type.value.indexOf("Conceptual Review")|-1}}>=0,40,0)
{{/}}
Thanks for the hint!
+ Leeland
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 you got it to 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.