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:
I also print out the size of the table for troubleshooting:
But for some reason, the print always comes empty even if the lookup found tickets or not.
And it looks like my IF doesn't work cause the result is nothing?
Does anyone know what's wrong?
Thanks!
Please provide the following for more context:
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
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:
This is the variable creation:
This is the log print:
This is the If:
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hii @Bill Sheboy ,
I changed the order,
So instead of :
I changed it to the order to what you said:
This is the automation now:
And it works now!!
Thank you for the help!
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.