JQL returns a count of issues, even though the date range is in the future (should be 0)

dave
Contributor
April 9, 2021

I am not clear why this returns a count, when it's future one would presume it returns 0

"Dev Team" = "My Team"AND status was in ("To Do") on "2021-04-09 00:01" AND status was in ("To Do") on "2021-04-09 23:59"

Assuming today is the 8th. The result is what was there in the day prior. This does not make sense to me.

3 comments

Comment

Log in or Sign up to comment
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.
April 9, 2021

Hi @dave 

Just a guess: are you using any Next-Gen projects in your instance?  If so, the status model seems have to "altered" the behavior, making WAS unreliable.  Here are the defects for this:

https://jira.atlassian.com/browse/JRACLOUD-70797

https://jira.atlassian.com/browse/JSWCLOUD-21154

Of note: this broke add-ons we had purchased also, as they depended upon status searches behind the scenes.

At this time, the only work-around seems to be to find the exact status id value and use that in your searches.  Even the REST API responses appear to have been impacted.


Best regards,

Bill

dave
Contributor
April 13, 2021

Thanks, @Bill Sheboy  No, we're using classic. But, I have heard about using a status ID ( a long long time ago) to resolve issues. I'll give it a try, but have a gut feeling that's not gonna solve the issue.

dave
Contributor
April 13, 2021

So running this query (10216 is To Do status)

"Dev Team" = MyTeam AND status was in (10216) on "2021-04-14 00:01" AND status was in (10216) on "2021-04-14 23:59"

and still showing an issue count, 38 Issues, for tomorrow. Wrong!

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.
April 13, 2021

Have you tried the ON with just date?  I am wondering if it is having a problem with the exact date time.  Maybe something like:

"Dev Team" = MyTeam AND status WAS 10216 ON "2021-04-14"

dave
Contributor
April 13, 2021

Just tried that

"Dev Team" = My Team AND status was in (10216) on "2021-04-14"

Still returns the count from the previous day.

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.
April 14, 2021

Hi @dave 

Would you please describe the problem you are trying to solve?  Why would you need a query to test for future history (that hasn't happened yet) just to get a zero record count?

Thanks,

Bill

dave
Contributor
August 9, 2021

So that I can create the chart today, and not have to come back everyday to update.

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.
August 11, 2021

Thanks, Dave.  I suspect you may stuck if you are trying to stay inside of out-of-the-box Jira to do this, as @Josh_Kochelek__Modus_Create notes about JQL interpreting the query to max-out on the current date for history changes.  (JQL isn't a SQL...)

If you are doing this query to chart in one of the plug-ins for Excel or GoogleSheets, perhaps you could add additional logic to make your chart correct, even though the returned data is a superset of what you want.

Other options are to:

  • investigate reporting/dashboard gadget addons from the marketplace which display exactly what you want, regardless of JQL interpretation of history
  • pull the history data using the REST API into another reporting tool
Josh_Kochelek__Modus_Create
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.
April 14, 2021

@dave - When using JQL historical operators (i.e. 'was') you are actually searching the history of changes in the issue. So, if you enter future dates into a query using the was operator, this is the exact same as querying what the value is currently. 

For example: 

If today is 4/14/21, consider the following queries:

Status WAS "To Do" DURING ("2021/05/01", "2021/05/01")
Status WAS "To Do" AFTER "2021/04/14"

These queries and similar queries (assuming the query is being run before the date in question) will return the exact same results as the following query 

Status = "To Do"

That being said, after the date in the query has passed, running the same query will give you the expected results, based on which issues historical values match the provided date or time frame. 

Please let me know if that makes sense or if I can clarify. 

Like # people like this
dave
Contributor
April 14, 2021

Thanks @Josh_Kochelek__Modus_Create , yes that makes perfect sense.

 

So how do I write/run the query where it will return 0 (my expectation)?

Mohamed Adel
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.
April 16, 2021

@dave  

May I ask if this issue works only when you add the next day as created in your query or it appears with any future date (let's say next week)? 

dave
Contributor
June 15, 2021

Thanks, @Mohamed Adel . Yes, for any future date if pulls that last "valid" date count of issues.

TAGS
AUG Leaders

Atlassian Community Events