Forums

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

Why is syntax for 'updated' JQL item "> -X" instead of "< X"?

mike
Contributor
June 18, 2018

I think this works for both "updated" and "updateddate".

To determine issues "updated in the last X" you must use "> -X" ("greater than negative X ago").  Why?

Trying to use "< X" ("less than X ago") seems to utterly fail.  I tried "<100d" for 100 days and was getting issues updated many years ago.

My question is not how does the syntax work, as I get it now, but why does it work this way?  Why doesn't `less than` actually work?

1 answer

1 accepted

2 votes
Answer accepted
Alexey Matveev
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.
June 18, 2018

Hello,

The point is that if you have a jql like 

updated < Xd 

It will give you all issues, which were updated BEFORE the currentDate + Xdays. Actually that will be all issues in your Jira instance, which were ever updated.

On the other hand if you type

updated > -Xd

means to find all issues which were update AFTER currentDate -X days and that is why it gives you only issues, which were updated from currentDate -X till now.

mike
Contributor
June 18, 2018

Is this just an inherent quirk of how JQL operates? 

It just doesn't seem very intuitive, like instead of 2 + 2 = 4, you have to say 2 - (-2) = -(-4), same things but one's clear and the other much less so.

Alexey Matveev
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.
June 18, 2018

I am used to it. To be honest I do not even remeber if I had problems with it or not :) but the point is that you compare dates, not intervals. The updated field is a date. That is why you can wirte only date1 < date2. You can not write date1 < interval. You can not compare intervals and dates. The same in Jira. Xd is an interval, that is why Jira converts it to a date: current date + Xd. That is why you can replace Xd with currentDate + Xd in your mind. And it will be logical.

mike
Contributor
June 18, 2018

Ah, knowing that it does make much more sense then.  Still not quite intuitive if you don't already know how to type it out, but oh well.  My initial issues with is is because I am usually using the Advanced search/syntax method where I type everything out, as opposed to the Basic syntax where you're selecting from dropdowns etc.  At first it had completely skipped my mind to simply use the Basic syntax to create a search, then select Advanced to see how to type it out.

Alexey Matveev
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.
June 18, 2018

If you feel like your question was answered, Kindly accept this answer. In this case other people with a similar question will be able to find this answer.

RG
Contributor
November 9, 2023

@Alexey Matveev  

 

updated > -Xd  (updated > -8d)

means to find all issues which were update AFTER currentDate -X days and that is why it gives you only issues, which were updated from currentDate -X till now. Today 9th Nov then it will show all tickets which were updated on or before 1st Nov. Correct?

updated < -8d What is the meaning of this?

Casey Gould
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.
March 7, 2024

@RG 

updated < -8d

Reading it across, this means updated BEFORE 8 days ago.

 

It might help to think of due date for this format. I often want to look for due dates between a certain period, so I would do JQL to search:

duedate > -15 days AND duedate < -1d

Translation: find me a due date between 15 days ago and 1 day ago (after 15 days ago and before 1 day ago).

Suggest an answer

Log in or Sign up to answer