Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I'm trying to create an automation that sends a Slack message listing the Jira items that meet a certain JQL query. I was able to set that up with the following objects:
*The following items are open in JIRA*:
{{#lookupIssues}}
* <{{url}}|{{key}} - {{summary}}> [{{status.name}}] ({{assignee.displayName}})
{{/}}
This works great, however it still sends that message even if there are no results from the Lookup's JQL query.
I tried wrapping it in an If-Then condition, but Jira then requires me to add the JQL to the Schedule component. By doing that it will then execute the Send Slack message component every time for each item in the JQL query results (which I obviously don't want to do).
What's the solution here?
You should be able to do this by checking the size of the list and then configure your if condition similar to this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The {{lookupIssues}} is a list, so all you have to do to get the size is to add .size to it like this {{lookupIssues.size}}. There are also other smart values that you can use with a list, check out https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Michael Glick Did you figure this out using list? If so, could you share?
I see that using Advanced Compare Condition with {{lookupIssues.size}} greater than 0 works.
Thanks for this thread!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register Now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.