Hi!
I try to configure some conditions based on "or" and "and" logic, but looks like it does not work.
I used this documentation - https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/
My example:
Total created issues: {{lookupIssues.size}}
{{#lookupIssues}}
• {{key}} {{summary}} by
{{#if(or(reporter.displayName.equals("Nico"),reporter.displayName.equals("Alex"),reporter.displayName.equals("Dmitry"),reporter.displayName.equals("John")))}}
11<b>{{reporter.displayName}}</b>11
{{/}}
{{#if(and(not(reporter.displayName.equals("Nico")),not(reporter.displayName.equals("Alex")),not(reporter.displayName.equals("Dmitry")),not(reporter.displayName.equals("John"))))}}
55<b>{{reporter.displayName}}</b>55
{{/}}
{{#if(reporter.displayName.equals("Nico"))}}
121<b>{{reporter.displayName}}</b>121
{{/}}
({{url}})
{{/}}
And in this case, the first and second "if" block does not work, nothing is added to email.
But the third "if" block without logical "or"/"and" works correctly.
Could you suggest me?
Thank you very much!
Hi @Nicolay Subbota -- Welcome to the Atlassian Community!
Thank you for your question: I believe you have discovered an ambiguity in the conditional logic documentation.
After a bit if testing it appears the documentation means that OR() and AND() can only have exactly two parameters: or( A, B). I confirmed this by passing one value, and it failed in the same way, until I added a dummy parameter. These functions are commonly understood to support chaining results, and so the documentation may be misunderstood.
So to make your use case work, change your rule to use nested OR() or AND() statements, such as this, where I grouped your first two conditions inside of another OR()
{{#if(or(or(reporter.displayName.equals("Nico"),reporter.displayName.equals("Alex")),or(reporter.displayName.equals("Dmitry"),reporter.displayName.equals("John"))))}}
11<b>{{reporter.displayName}}</b>11
{{/}}
I will post this information in the article on conditional list filtering to help others: https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588
Kind regards,
Bill
Yes, that is perfect! Works like a charm. Thank you!
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.