Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for proper condition to return string when a filtered list smart variable returns no results

Keith Vedol October 19, 2022

Hi,

 

I am currently using smart values to fetch a list of issues that meet the category criteria.  There are currently three categories, and I would like a message to be returned if no issues are found for a specified criteria.  So if the three categories are:


Category 1

Category 2

Category 3

 

If the filter is for example: (fixVersion = '{{version.name}}' AND "Category[Dropdown]" = "Category 1" ORDER BY cf[10530] ASC, key ASC

 

and it has been added to a variable ( {{varCategory1}} )

and if there are no results returned, I would like to return a message saying no results were found under that category.  Which conditional logic string would be best to achieve this? 

 

I have tried many ways according to the documentation and haven't gotten it right as of yet, with the latest being:

 

{{#if(lookupIssues.size.gt(0))}} <b>No issues under this category were found</b>.{{/}}
{{#if(exists(varCategory1))}}
{{varCategory1}}{{/}}

 

Any assistance or suggestions would be greatly appreciated. Thanks.

1 answer

0 votes
Trudy Claspill
Community Champion
October 19, 2022

Hello @Keith Vedol 

Can you show us the entire rule?

Generally, after executing a Lookup Issues action you could add an Advanced Compare condition to check if the value of {{lookupIssues.size}} equals 0. 

How do you expect the message to be surfaced? Are you adding it to an email?

Keith Vedol October 19, 2022

Got it figured.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events