Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Jira Cloud Automation: Scheduled JQL Trigger Slack When Issues Are Found

I'd like to create a project rule that runs on a specific interval defined by Cron. It should run JQL. I then have an action to 'LookupIssues' to reference those issues in the Slack post. However, it should not run if 0 issues are found in the JQL. My rule works (always even if 0 issues found), and currently looks like this:

When: Scheduled -> Then: Lookup issues -> And: Send Slack message

I tried to use if/else blocks but getting errors when trying to publish. The message is saying I must check the box "Run a JQL search and execute actions for each issue in the query" within the advanced (CRON expression) tab in Scheduled trigger. There seems to be a certain combination where CRON is used that the box is not checked.

The reason I do not want that boxed checked is because if multiple issues are found in the JQL, my slack post will post the same thing for every ticket.


Ultimate goal: Have 1 slack post that includes any number of lookup values if 1 or more issues is found in JQL. If no JQL values are found, do not run the rule. The rule runs on a schedule defined by CRON.

Anyone currently doing this and have a solution? Thanks.

1 answer

1 accepted

2 votes
Answer accepted
Sam Harding Atlassian Team Jun 22, 2020

Hi Adam,

This should be possible using the components you are currently using. With your configuration, are you using 'Run a JQL search ....' on the CRON, as well as the lookup issues action? To achieve what you are wanting it should be able to use that component chain without having to specify the JQL check box in the CRON. I believe this combination should achieve what you are wanting:

1. Scheduled Trigger: 'Advanced CRON' selected, 'Run JQL....' not selected.
2. Lookup Issues Action: Specify the JQL criteria
3. Advanced Compare Condition: For the condition type, select 'Advanced Compare Condition'. Here, input the values {{lookupIssues.size}} greater than 0
4. Send Slack Message: Send your message, the lookupIssues variable by this point should always be a non 0 list of issues

Is this the same set up as what you have been attempting? If not, can you give that a try and see if that is successful?


Your directions worked perfectly Sam. The issue was missing step 3. Once I added that everything was as intended.


Like Sam Harding likes this

Hi Sam,

This answer was helpful for me as well, I essentially had the exact same problem that Adam had.

Looking at the documentation here:

I assumed that the fields listed were the limit, and it mentions that "smart values" were not available to be used with {{lookupIssues}}. 

I haven't searched the docs extensively, but is there a resource that would have allowed me to figure out on my own that the .size attribute could be used on {{lookupIssues}}?

Doing a little bit of searching, it seems like .size is a "smart value" associated with lists, can I treat {{lookupIssues}} as a list in other ways?




I came here to comment that it helped me as well!


Good job Sam.





Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Apps & Integrations

Marketplace Partner Spotlight: AppLiger

This month the spotlight is on AppLiger. We caught up with Pavel Pavlovsky, CEO and Product Manager, to learn how the company started and what fuels the team's creativity.    Atlassian:...

389 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you