Lookup isssues | Validate Query returns false values
Asked by Tim Chaffin:

So I have an automation that uses a ++Lookup issues Action++ with some JQL to send some Slack messages off for the day.

The JQL is:

```
type = Deployment and resolution = Unresolved and Due = startOfDay()
```

The purpose is just to be a simple reminder to the team that "*Hey, we've got some deployments we need to kick off today."*

When I click on the "Validate Query" button, I get no results, as expected. When I open a new tab and run the query through an advanced JQL query, I get no results, as expected. However, when the automation runs, it returns 3 issues. These 3 Deployment issues happen to be due tomorrow, and are the only ones open at the moment.


Answers:
author: Tim Chaffin
body: Okay, everyone here got me close to the answer, so I really appreciate it.

Here is what I ended up having to do to fix this:

I had to change the Default User Timezone. (Jira Cloud) Settings ? System ? Edit Settings ? Edit Region and Time Zone to match user base.

After I did this, the Automation worked as expected.

I chose this route instead of a hacky fix like startOfDay(-7h). Our user base, and our engineers are all located in this timezone and if I'm going to run into this problem, so are many others. Might as well just set things up right now.

This is a little perplexing to me. So, I'm going to make a few assumptions, and I'd love to hear from an engineer or a Jira SME to chime in:

* Queries, JQL, and general operations performed through the browsers assume the timezone set by the browser. I believe this would explain why the Validate Query button, and the Advanced Query function would work as expected.
* However, when automation tasks are executed on the backend, they are executed with the timezone defined in the System Settings. Thus, a varied experience in outcome.

This is probably buried in the docs somewhere.

comments: author: Fabian Lim
body: Yes it's buried in their training in the jql university courses. That's why I was able to guide you about timezones as they have a full video on it.

Regards


author: Curt Holley
body: > You could try using endofday () might help cover any timezone confusion due to time of running the automation.  
> I just did a test and get the same results as using startofday ()

comments: author: Tim Chaffin
body: I too tried startOfDay() and endOfDay(). And received the same result. What confuses me, however, is when I validate the query, I get the expected 0 results. When the automation runs, I get unexpected results.


author: Fabian Lim
body: Hi [@Tim Chaffin](/t5/user/viewprofilepage/user-id/419836)

It's possible that it's failing due to the timezones in the profiles. You may be in est, but the automation for Jira is at UTC.

Here are some details: <https://community.atlassian.com/t5/Jira-Software-questions/Jira-Automation-and-CRON-settings/qaq-p/1543231>

Regards

comments: author: Tim Chaffin
body: Alright, I gave that a shot, but I'm not sure that's the smoking gun.   

First, I'm not using a CRON expression for my schedule. I'm using the calendar GUI where I can define my timezone (America / Denver) by the way.   

Second, wouldn't that only impact when the automation is executed? Not how the JQL is evaluated? Unless I can apply a timezone to a JQL? Although I've never had to do that before.