Automation Rule Failing Even Though Condition is Not Met
Asked by Damien:

Hey guys,

So I encountered this strange problem. I have a simple automation that runs a JQL on a schedule and if any issues show up, **processes them in bulk** and emails their assignees with some stuff. The automation is working just fine when the JQL returns issues, but when it doesn't, I get an email that it failed (as per the "Notify on error" setting). The audit log is showing the "Some Errors" status with the following error message:

![Some Errors.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/315400iF2F6605937DD7EA6/image-size/large?v=v2&px=999 "Some Errors.JPG")

Apparently, it is still trying to send the emails, even though there are no issues, produced by the JQL. Since the automation is checking for tickets every day, and tickets will be there, say, 30% of the time, I'd be getting these automation failed messages almost every day. Naturally, I can just make it to not send me emails whenever it fails, but this is more of a workaround, rather than a solution.

Has anyone encountered this?


Answers:
author: Ste Wright
body: Hi [@Damien](/t5/user/viewprofilepage/user-id/5425510)

I assume this is DC?

I don't have this issue when I tested this (in Cloud or DC) - it just states "No actions performed"

You could try using a Condition, but not sure if it will work...

* **Condition:** Advanced compare condition
  * First Value = {{issue.size}}
  * Condition = does not equal
  * Value = 0

---

If this doesn't work, you might be able to...

* Use a **Lookup Issues**action to re-run the JQL
* Use a similar Condition as above, but use the smart value {{lookupIssues.size}}...
  * First Value = {{lookupIssues.size}}
  * Condition = less than
  * Value = 1

---

Let us know if either of these work!

Ste

comments: author: Bill Sheboy
body: Hi [@Ste Wright](/t5/user/viewprofilepage/user-id/1166470)

With the bulk-handling feature of Server / Data Center rules, I believe the smart value is plural: {{issues}}

And so the condition would be on: {{issues.size\|0}}

Thanks, and kind regards,  
Bill


author: Ste Wright
body: Thanks Bill :)

Ste


author: Damien
body: I am happy to report that Stephen's suggestion worked perfectly! And, yes, as Bill mentioned, it's {{issues.size}}.


author: John Funk
body: Great!


author: John Funk
body: Hi Damien,

One way to solve is to create a Condition using JQL right after the scheduled trigger. Use the exact same JQL. I know that is redundant, but now the Condition will fail and the rule will stop processing short of the Send email action.


author: Bill Sheboy
body: Hi [@Damien](/t5/user/viewprofilepage/user-id/5425510)

Do you want to still send an email (perhaps with a **different message body** ) when there are no issues, or **send no email message**?

If you want to send no email message, try the condition suggested by Stephen and John.

If you want a different message, you could use conditional logic within the email body to show different content for the cases: <https://confluence.atlassian.com/automation/jira-smart-values-conditional-logic-1081351607.html>

Kind regards,  
Bill


author: Damien
body: [@Ste Wright](/t5/user/viewprofilepage/user-id/1166470), [@John Funk](/t5/user/viewprofilepage/user-id/5415940) , thank you very much for the speedy responses! I'll try your suggestions on Monday :) Meanwhile, I tested the same automation rule **without** the "Process all issues produced by this trigger in bulk" and got the "No actions performed", so there we have it, it's this option that "messes it up".

comments: author: Ste Wright
body: Let us know how it goes :)

Ste