Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automation filter list two using "And" two different fields

Melissa
Contributor
January 27, 2025

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 {{/}}

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 27, 2025 edited

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

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events