I'd like to use automation to check if an issue does not match a specified JQL, and if there is not a match, then create an issue.
project = FOO AND type = Task AND resolution = Unresolved AND labels not in (BAR)
This would result in zero matches because the ticket was resolved. Then automation would create another task.
On a weekly basis we perform several routine tasks, if there is already a task then there is no need to have another task created before the current one is closed.
Hi @Brad Prusa ,
I would try something in these lines:
Hope it helps
Thanks. I tried something similar for my version but get an error that block can't be empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Add something silly there, like send an email to yourself, or if you find something even less impactful - that should work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm.... it's not working because there are no matches I think.
For example:
1. The first When query finds 4 tasks that are open.
2. Then it looks at those 4 tasks and sees that none of them have the label bar, so it sends an email. There are no remaining issues at this point for it to create a new task.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Brad Prusa
Welcome to the Atlassian community.
Have you already tried to create this automation rule? If so, please show us what you have so far and the details of each step.
What version of Jira Data Center are you using?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I've tried many different ways: if statements, if related issues condition with none match JQL matching non condition. It seems the issue is because automation finds no results, so there isn't an action to take without a match.
It looks like we are using Jira Project Management v9.12.12
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you're in the right track, you just need to invert the logic to the else block - as jira works mostly on iteration over tasks, and don't naturally support querying "lack of tasks".
Try this same setup but in the else block, with something un-impactful such as log action in the if-true block
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not following what you mean. I'm starting to think this isn't possible because if there are no matches, then nothing is triggered.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I recommend a different logic to the construction of the rule.
You can still use the Scheduled trigger, but don't include a JQL in it.
Follow that with a Lookup Issue action where you execute the JQL that would find the issue, if it existed.
Follow that with an Advanced Compare condition to see if the results of that Lookup Issues was 0 issues found.
And if that condition passes (0 matching issues found) then execute your Create Issues action. An issue will be created only if no matching issues were found.
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.