Forums

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

JQL WAS IN and WAS NOT IN clause getting different results

David Leal
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.
May 3, 2022

I have only the following statuses in my JIRA project: 

'To Do', 'In Progress', 'In QA', 'ON HOLD/BLOCK', Completed, DONE and the BACKLOG

I am looking for stories on the following statuses: 'To Do', 'In Progress', 'In QA', 'ON HOLD/BLOCK', Completed on a given time. 

I am using the following two queries and they provide different results and per my understanding it should not:

project in (DCK, TGK) and fixVersion in (Athena) and issuetype 
in (Story) and status was in ('To Do', 'In Progress', 'In QA',
'ON HOLD/BLOCK', Completed)
ON '2022-04-13' ORDER BY created DESC

 

project in (DCK, TGK) and fixVersion in (Athena) and issuetype 
in (Story) and status was not in (DONE, BACKLOG) ON '2022-04-13'
ORDER BY created DESC

on the first query I got: 109 issues and on the second one I got: 148

This is the result for the first query:

2022-05-03_18-27-30.jpg

Result of the second query: as you can see it returns stories created after that referenced date:

2022-05-03_18-17-31.jpg

Thanks in advance for any help

1 answer

1 vote
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.
May 4, 2022

Hi @David Leal 

Are those company-managed or team-managed projects?  If they are company-managed the projects share the definitions of the status values (by name and id), but if they are team-managed my understanding is the status id values are different and so the name-based query may be causing confusion.

Next, that second query result is interesting as it appears correct as the later created issues were, in fact, not in those status values on that date.  Perhaps try restricting by create date also:

project IN (DCK, TGK)
AND fixVersion IN (Athena)
AND issuetype IN (Story)
AND status WAS NOT IN (DONE, BACKLOG) ON '2022-04-13'
AND created <= '2022-04-13'
ORDER BY created DESC

Kind regards,
Bill

David Leal
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.
May 4, 2022

Thanks @Bill Sheboy it is a company-managed project. Adding created condition restrict the search, but it should not be necessary in my opinion, now I am getting the same count, but for the first query there is no need to add this additional constraint, for me it is weird or may be a possible bug, or maybe I am not understanding how those clauses work 

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.
May 5, 2022

JQL does exactly what we ask (usually), and without the extra Created condition, your query is essentially saying "I do not care when these were created...just show issues NOT in this status on this day...", which would be everything else.

If you still believe this to be a defect, please work with your site admin to submit a ticket to the Atlassian Support Team to take a look: https://support.atlassian.com/contact/#/

David Leal
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.
May 7, 2022

@Bill Sheboy I think you are correct, adding in both queries the created condition will reduce the differences in the number of stories returned. The WAS NOT missed on the story: DCK-2195 that was transitioned from Backlog to IN PROGRESS on 4/13/2022 and maybe some other added in order to return 108 vs 107

 

Screen Shot 2022-05-07 at 3.20.01 PM.png

Screen Shot 2022-05-07 at 3.39.19 PM.png

so I think there is a bug. The query checked also mark as an error (red x) after I enter the ON predicate.

Thanks,

David

Suggest an answer

Log in or Sign up to answer