Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

datediff does not work

Anne Varghese November 29, 2023

am trying to find difference between two dates, the MINUS sign does not work, the datediff function does not work 

2 answers

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 30, 2023

Hi @Anne Varghese 

There is nothing in out-of-the-box JQL to compare date fields.  JQL is not an SQL, and so does not have such features.

How often do you need to perform this query?

  • need this often: investigate either a marketplace addon for JQL or using automation rules
  • need this infrequently: export the issues to a spreadsheet and perform the comparison there

And just to confirm, are you using Jira Cloud, as your post seems to indicate that?  If so, Automation for Jira rules are built-in with that product.  And it appears you are using the Premium license level, and so the impact of the execution limits are less likely to impact you if you need to create a rule.

Kind regards,
Bill

0 votes
Ste Wright
Community Champion
November 29, 2023

Hi @Anne Varghese 

Where are you trying to find the difference between these two dates?

Some more information about the feature or scenario would be great :)

Ste

Anne Varghese November 29, 2023

That was a quick response, thank you; 

sample Jira JQL on Jira board , below works, however, when I want difference between TWO DATES <typical scenarios is =ticket "technical approval date"  should be less than 180days of "release date">  - 

I tried datediff function, minus sign symbol - both failed.

 

sample query 

project = S4 AND type = Epic and status in ("In QA", "Ready To Deploy To Production") ORDER BY status DESC

expectation:

project = S4 AND type = Epic and status in ("In QA", "Ready To Deploy To Production") AND

"TDA Approval Date" - "Target End Date" < 180d OR 

datediff ("TDA Approval Date", "Target End Date" , "d") < 180d 

Anne Varghese November 29, 2023

How do I find difference between two dates using JQL, Atlassian Jira and Jira Plugins
License Information for Jira
Jira v8.22.6

 

THANK YOU

Ste Wright
Community Champion
November 30, 2023

Hi @Anne Varghese 

This isn't possible natively - but do you have Automation on your Jira instance?

If yes, I would...

  • Create a number field - eg. Date Difference
  • Use Automation to calculate the difference between the two dates, and populate this field

...and use this in the JQL search instead :)

Let us know if you'd like more specific instructions on how to do this!

Ste

Anne Varghese November 30, 2023

Thank you Ste ... No, I do not have automation .. and yes the confirmation that datediff does not work on Native Jira should suffice for my current task -will try to explore more with automation if possible, thank you so much,

Ste Wright
Community Champion
November 30, 2023

Hi @Anne Varghese 

Do you have any Apps? Looking for one which might help here :)

Ste

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events