Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Lookup isssues | Validate Query returns false values

Tim Chaffin May 23, 2022

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.

3 answers

1 accepted

3 votes
Answer accepted
Tim Chaffin May 23, 2022

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. 

Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 24, 2022

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

0 votes
Curt Holley
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 23, 2022

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 ()

Tim Chaffin May 23, 2022

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. 

0 votes
Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 23, 2022

Hi @Tim Chaffin

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

Tim Chaffin May 23, 2022

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. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events