Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you will find the site temporarily inaccessible. Thanks for your patience. Read more.
×Hello!
I need to filter down a list in our automation, Any suggestions welcomed!
Currently I'm using -- {{#Issues}}{{#if(equals(status.name, "Approved"))}} {{/}}
But I need to narrow it down to only show items from Project XYZ
I'm not sure how to combine two different fields. I tried
{{#Issues}}{{#if(and(status.name, "Approved", project.key, "PP"))}} {{/}}
{{#Issues}}{{#if(and(equals(status.name, "Approved", project.key, "PP")))}} {{/}}
Documentation Shows the following for "and" but doesn't speak on combining two fields - {{and(smartValue1, smartvalue2)}} returns true or false {{#if(and(issue.Votes.gt(100),issue.Votes.lt(150)))}} Moderately Popular issue {{/}}
Hi @Melissa
The and() function in smart value expressions takes two Boolean parameters; basically, any expressions which could evaluate to true or false.
In the documentation example, the gt() and lt() functions return those Boolean values.
For your case, perhaps try using two equals() functions within the and() function:
{{#issues}}
{{#if(and(equals(status.name, "Approved"), equals(project.key, "PP")))}}
return something...
{{/}}
{{/}}
Please note well: the and() / or() functions only take two parameters. When more expressions are needed, they must be nested. Such as with this:
{{#issues}}
{{#if( and(myFirstExpression, and(mySecondExpression, myThirdExpression) ) )}}
return something...
{{/}}
{{/}}
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.