How to call current date and time in JQL?

IT Admin November 24, 2023

 

My JQL code:
Status = Schedule AND "Planned Start" = Current Date and time??

Screenshot 2023-11-25 141402.png

I just want to get the real-time date and time

 

3 answers

2 accepted

11 votes
Answer accepted
Tim Kopperud
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 25, 2023

Hi @IT Admin, you can use the JQL function now(). See the syntax for this here

Notice the time is stored and compared in milliseconds hence using a JQL like the one below will normally give zero results.

Status = Schedule AND "Planned Start" = now()

This because Jira returns the the exact millisecond for now() which normally will be a larger number than the exact minute for the current time, and the stored time in Planned start will have stored milliseconds only to the exact minute. 

This image shows an example of this. I created an issue and the executed this query within 2 seconds after the creation. 

image.png

So in prectical sense > (larger than) or < (smaller than) gives more usefullness for the now() function than = (equal). 

You can use other meassures to return the wanted issues. E.g using a period format. This JQL in example returns all issues created within the last minute.

created > "-1m"

So for your JQL something like this might be working

"Planned start >= "-1m" AND "Planned start" < "1m"

This will return all issues within the current minute of the JQL execution. You might try and play around with it. 

TimK. 

4 votes
Answer accepted
Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 25, 2023

@IT Admin -

To supplement what @Tim Kopperud suggested, here is a reference link on JQL syntax that can assist you further on date fields -

JQL Functions - https://support.atlassian.com/jira-software-cloud/docs/jql-functions/

JQL Advanced Search - https://support.atlassian.com/jira-software-cloud/docs/what-is-advanced-search-in-jira-cloud/

Hope this also helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Technology Applications Team

Viasat Inc.

Hello,

You can check the JQL Functions on Jira support https://support.atlassian.com/jira-software-cloud/docs/jql-functions/.

You can check now() function that search based on current time.

Regards,

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events