Error code - automation rule
Asked by Dietra Winkfield:

I received the following error message when trying to implement an automation rule that sends an email to the reporter when a task is due within 3 days. How do I correct the error?

![Screenshot 2024-05-10 093908.png](/t5/image/serverpage/image-id/323079i8097BCC265D0AF38/image-size/large?v=v2&px=999 "Screenshot 2024-05-10 093908.png")


Answers:
author: Matt Parks
body: It looks like your JQL Search needs to be modified. Right now, part of it says "and assignee =)", so there probably needs to be a value between the '=' and the ')'

comments: author: Trudy Claspill
body: Hello [@Dietra Winkfield](/t5/user/viewprofilepage/user-id/4601365)

Adding to this...

Can you show us the actual JQL statement used in the Automation? And please show us the full rule.

In the error message where no value is shown between 'assignee=' and the closing parentheses, that is usually an indication that a smart value has been used in the JQL, and a value can't be obtained for that smart value.

You may have a syntax error in the use of the smart value, or the smart value may be out of context at the point the JQL is used.


author: Dietra Winkfield
body: Thank you for responding.

Here is the JQL statement: duedate \<= endOfDay({{numberOfDaysBeforeDueInclusion}}) AND statusCategory != done AND assignee != empty

The full rule:

![Screenshot 2024-05-13 101035.png](https://community.atlassian.com/t5/image/serverpage/image-id/323346i976BEDB1532C2C6F/image-size/large?v=v2&px=999 "Screenshot 2024-05-13 101035.png")![Screenshot 2024-05-13 101111.png](https://community.atlassian.com/t5/image/serverpage/image-id/323345i3755451AB8EAAA73/image-size/large?v=v2&px=999 "Screenshot 2024-05-13 101111.png")


author: Trudy Claspill
body: Try this JQL statement instead, making the change I highlighted in **bold** text:

duedate \<= endOfDay({{numberOfDaysBeforeDueInclusion}}) AND statusCategory != done AND assignee **is not EMPTY**


author: Dietra Winkfield
body: It did not work. I am still getting the error code.![Screenshot 2024-05-14 093200.png](https://community.atlassian.com/t5/image/serverpage/image-id/323614iE2BF38BC7A242A1E/image-size/large?v=v2&px=999 "Screenshot 2024-05-14 093200.png")


author: Trudy Claspill
body: For confirmation of the change can you show us a screen image of the modified JQL used in the Lookup Issues action in the rule?

The error message shows an "=" after "assignee". That should not be there if you modified the JQL as I suggested.


author: Dietra Winkfield
body: ![Screenshot 2024-05-14 112839.png](https://community.atlassian.com/t5/image/serverpage/image-id/323637i9D5D5BFEEBD56494/image-size/large?v=v2&px=999 "Screenshot 2024-05-14 112839.png")![Screenshot 2024-05-14 112814.png](https://community.atlassian.com/t5/image/serverpage/image-id/323636iCF9C5E6577405AAA/image-size/large?v=v2&px=999 "Screenshot 2024-05-14 112814.png")


author: Trudy Claspill
body: Okay, I see. The Lookup Issues action that is having the problem is the one inside the branch where the JQL includes

assignee = {{distinctAssignee}}

{{distinctAssignee}} has no value

Can you explain to us what you are trying to accomplish with this rule?

It appears that you are first looking for issues that are not done, that also have an Assignee value, and that are due within a specified number of days.

![Screenshot 2024-05-14 at 12.24.17?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/323664i1D8802924447E544/image-size/large?v=v2&px=999 "Screenshot 2024-05-14 at 12.24.17?PM.png")

Next it appears that you are trying to set up another action, perhaps for each unique Reporter you found in the first list. Is that correct?

![Screenshot 2024-05-14 at 12.25.04?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/323667iF5F7AF38AADD4BEC/image-size/large?v=v2&px=999 "Screenshot 2024-05-14 at 12.25.04?PM.png")

And then for each unique reporter you are trying to do another retrieval of issues. But I don't understand what you are trying to do in this JQL with the {{distinctAssignee}} smart value.

![Screenshot 2024-05-14 at 12.26.08?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/323668iE64CE77D4A310464/image-size/large?v=v2&px=999 "Screenshot 2024-05-14 at 12.26.08?PM.png")


author: Dietra Winkfield
body: I want to be able to not only send the reporter a list of tasks that are coming due that they are the reporter on. I have another rule set up for the assignee to get notified.


author: Trudy Claspill
body: Hello Dietra,

Based on your answer it sounds like there is no reason to have the **AND assignee = {{distinctAssignee}}**clause in the JQL in the Lookup Issues action within the branch.

It sounds like instead you need to have **AND reporter = {{distinctReporter}}** if you want to get the list of just the issues for each reporter to include in the email.

Do you want to give each reporter a list of only the issues reported by them that also have an Assignee value? I ask because that is how the JQL in your first Lookup Issues action is written. If you do want to include only the issues that have an assignee then your JQL within the branch should be

duedate \<= endOfDay({{numberOfDaysBeforeDueInclusion}}) AND statusCategory != done AND assignee **is not EMPTY AND reporter = {{distinctReporter}}**

Can you also show us:

1. The details of the trigger. Do you have a JQL statement in the trigger?

2. The details of the Create Variable step.


author: Dietra Winkfield
body: Your suggestions in the first two paragraphs fixed the problem. The automation is now working as I want it to. Thank you!


Tags: cloud

jira-work-management-cloud