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?
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
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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\""
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.