Unexpected behaviour in filter query? (aka Am I doing something wrong?)

Dan Brown May 19, 2015

We have the following default filter query for a Kanban board.

(
    (project = "Red Projects" OR component = TeamRed) 
     AND resolution = Unresolved
) 
OR     
(
    (component = TeamRed OR project = "Red Projects")
     AND (status = Done OR status = Closed OR status = Resolved)
     AND updated < 15d
) 
ORDER BY Rank ASC

What we are doing here is trying to see all unresolved items, as well as any resolved items which have been updated less than 15 days ago.  We are still having tasks/bugs/epics/etc show up (going by the last updated date) which are much older than this.  There's one right now for example which has a last updated date of 2012/12/01.

So a couple of things which I've noted.

  • The updated < 15d seems to be ignored when you use < 15, but on the other hand shows only 27 items (all unresolved) instead of the entire list of 147 items.
  • nested queries are broken down by Atlassian into singly bracketed queries.

eg. the above actually ends up as the following which makes no sense.

(project = "Red Projects" OR component = TeamRed) 
AND resolution = Unresolved
OR     
(component = TeamRed OR project = "Red Projects")
AND (status = Done OR status = Closed OR status = Resolved)
AND updated &lt; 15d
ORDER BY Rank ASC

 

We could of course use the Kanban releases but have yet to see a thorough enough explanation which doesn't sound like it's going to release all of the project tasks/stories/bugs/etc from other boards as well.

 

 

 

1 answer

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
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 19, 2015

I think you've got your relative dates wrong, if I am reading the question correctly.  Might be easier to explain the clause:

AND updated < 15d

That means "updated date is before a date 15 days in the future ".  I think you actually want:

AND updated > -15d

That means "updated after a date 15 days in the past"

(Also, the default for "no units" is usually minutes, so <15 is the same as <15 minutes)

Dan Brown May 19, 2015

Thanks! I will keep this in mind. It would be incredibly rare I'd refer to a date in the future at all so that didn't cross my mind at all.

Nic Brough -Adaptavist-
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 19, 2015

No problem, I do exactly the same all the time when I'm sketching out JQL I do search in the future, but it's usually something like "due date in the next two weeks", but dates in the past do form the vast majority of everyone's searches in my experience!

Suggest an answer

Log in or Sign up to answer