Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

Edited

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

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

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.

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!

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"

Just tried that

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

Still returns the count from the previous day.

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

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

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

@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

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 Community Leader Apr 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)? 

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

Comment

Log in or Sign up to comment
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you