Forums

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

Automation JQL returns 0 items, filter with same JQL returns 2

Robert Hook
Contributor
July 17, 2025

I am using a scheduled daily task as a trigger, and I am checking the "Run a JQL search and execute actions for each work item in the query" box within the trigger. When I validate the query or run the rule, it says 0 work items found. However, if I click the link for 0 items found, it pulls up a list of two work items. Likewise, if I simply filter my "all work items" queue with that JQL, then it pulls up two work items. What am I missing with the automation not finding any items?

automation1.jpgautomation2.jpg

1 answer

1 accepted

7 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 Champions.
July 17, 2025

Hi @Robert Hook 

What is the full JQL expression for your search / trigger?

 

What is the scope of your rule in the details at the top: single-project, multiple-project, or global?

And, if the rule is single-project scope, is the rule defined in the "IT ServiceDesk" project?  If not, it cannot "see" those work items and the scope would need to change.

 

Kind regards,
Bill

Robert Hook
Contributor
July 17, 2025

@Bill Sheboy 
Thanks for the reply. I have tried running the rule as Global and as single project within the IT Service Desk project - in both cases it finds zero issues.

The full JQL is below. The reporter string is for the Automation for Jira account (which is listed as the reporter for the sub tasks that I am targeting).


project = "IT ServiceDesk" AND reporter = 557058:f58131cb-b67d-43c7-b30d-6b58d40bd077 AND summary ~ "Jira subtask - New Hire*" AND statusCategory NOT IN (Done) AND duedate = endOfDay() AND type = Sub-task or type = Subtask

Like John Funk likes this
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 Champions.
July 17, 2025

Thank you for that information, and...

 

First, let's add some parentheses for the issue type check to enforce the order of precedence in the JQL:

project = "IT ServiceDesk" AND reporter = 557058:f58131cb-b67d-43c7-b30d-6b58d40bd077 AND summary ~ "Jira subtask - New Hire*" AND statusCategory NOT IN (Done) AND duedate = endOfDay() AND ( type = Sub-task or type = Subtask )

Or better still, use the IN operator:

project = "IT ServiceDesk" AND reporter = 557058:f58131cb-b67d-43c7-b30d-6b58d40bd077 AND summary ~ "Jira subtask - New Hire*" AND statusCategory NOT IN (Done) AND duedate = endOfDay() AND type IN (Sub-task, Subtask)

Now test that updated expression stand-alone first, and compare the results to trying it in the trigger.

 

Next, if the query works outside the rule but not inside the trigger, I wonder if this a problem with the CONTAINS ~ operator and the wildcard * on the summary value.

You could try removing the wildcard and using an exact search phrase instead for that prefix:

summary ~ "\"Jira subtask - New Hire\""

 

Like # people like this
Robert Hook
Contributor
July 17, 2025

@Bill Sheboy 

Thank you. The issue seems to lie with the summary check in the JQL. When I remove that as a criteria, it finds the two issues. When I put in the expression you suggested...

summary ~ "\"Jira subtask - New Hire\""

...it returns one of the two results, which makes sense given their slightly different summaries. I can get the summary part cleaned up, so I think your solution should work going forward. I really appreciate the help.

Like # people like this

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