Forums

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

Why the {{lookupIssues.size}} return nothing instead of a number

Ofir Oxenberg May 22, 2025

Hello, 

 

I have an automation that searches for tickets with a certain condition and populates a table with the tickets it found. 
i am taking into account that the table can be empty and that is why I have an IF that checks:

Screenshot 2025-05-22 at 17.16.02.png

I also print out the size of the table for troubleshooting:

Screenshot 2025-05-22 at 18.19.29.png

But for some reason, the print always comes empty even if the lookup found tickets or not. 

Screenshot 2025-05-22 at 18.15.02.png


And it looks like my IF doesn't work cause the result is nothing? 
Does anyone know what's wrong? 

Thanks!

1 answer

1 accepted

5 votes
Answer accepted
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.
May 22, 2025

Hi @Ofir Oxenberg 

Please provide the following for more context:

  • an image of your complete rule, shown in one single image for continuity
  • an image of the complete audit log details for the execution, with all of the areas at the right side of the log expanded

Until we see those...

When using the Lookup Issues action in a rule, I have observed it intermittently not return a 0 count when no work items are found.  The solution for that is to add a default of 0 for the size function to handle null values:

{{lookupIssues.size|0}}

 

Kind regards,
Bill

Ofir Oxenberg May 26, 2025

Hi @Bill Sheboy 
I cannot take a picture of the entire rule, it is too long. 
I took a picture of the problematic part and the lookup result.

 

This is the lookup action:

Screenshot 2025-05-26 at 14.38.59.png

This is the variable creation:

Screenshot 2025-05-26 at 14.36.19.png

This is the log print:

Screenshot 2025-05-26 at 14.37.02.png

This is the If:

Screenshot 2025-05-26 at 14.38.16.png

This is what I see is printed in the Audit log under the log print.
As you can see the lookup table size is not returning 4.

Screenshot 2025-05-26 at 14.34.11.png

I think the issue might be with the variable creation, but I'm not sure what am I doing wrong. 

I would like to have an array variable consisting of the "issue key - issue summary" for every ticket the lookup finds.

And then if the array is bigger than 0 - continue in the automation. 



And regarding your recommendation to use - 

{{lookupIssues.size|0}}

Where should I use it? After creating the variable? 

Kind regards,

Ofir.

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.
May 26, 2025

Hi @Ofir Oxenberg 

First, when you have a longer rule and want to post an image of it, please try using a browser addon or screen capture tool which supports scrolling page capture.  Thanks!

 

For your original question post with the Smart Values Condition, you could add the default value:

  • smart values condition:
    • first value: {{lookupIssues.size|0}}
    • condition: greater than
    • second value: 0

 

Reviewing everything you show in the rule images...the size function works on a list.  And the Create Variable action always produces text.  And thus when you try the following the results will be null because the variable is not a list:

{{pendingUnderWeek.size}} or {{pendingUnderWeek.size|0}}

 

Please try updating your rule to the following:

  • trigger: scheduled, with no JQL
  • action: lookup work items
  • smart values condition:
    • first value: {{lookupIssues.size|0}}
    • condition: greater than
    • second value: 0
  • some action that needs the lookup results, such as logging, email, message, etc.

 

Ofir Oxenberg May 28, 2025

Hii @Bill Sheboy ,

 

I changed the order, 

So instead of :

  • trigger: scheduled, with no JQL
  • action: lookup work items
  • Variable creation
  • smart values condition:
    • first value: {{VariableName.size|0}}
    • condition: greater than
    • second value: 0

I changed it to the order to what you said:

  • trigger: scheduled, with no JQL
  • action: lookup work items
  • smart values condition:
    • first value: {{lookupIssues.size|0}}
    • condition: greater than
    • second value: 0
  • Variable creation

 

This is the automation now: 

Screenshot 2025-05-28 at 10.08.56.png

And it works now!! 

 

Thank you for the help!

 

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events