I posted a similar question: JQL WAS IN and WAS NOT IN clause getting different results and improved the query thanks to the response received, but still I am getting a different jira issue count and result. I would like to find all story and bugs that were in the pipeline (ready for the teams to work) at a given time. In our project we have the following statuses: To Do, In Progress, In QA, ON HOLD/BLOCK, Completed, DONE and BACKLOG.
The following two queries should give the same result, because everything that is not in the BACKLOG or DONE is ready for the teams to work. Similarly If I check for issues in valid statuses: To Do, In Progress, In QA, ON HOLD/BLOCK, Completed should produce the same result. The query combines several jira projects which is a mix of Scrum and Kanban type of project. My intention with the query is to identify the work that was planned (pending and ready to work) at the beginning of the iteration 2023-01-18.
Query1: Not Done not in the Backlog
PROJECT IN (PPC, CATR, DET,BIA) AND FIXVERSION IN (Devas)
and ISSUETYPE IN (Story, Bug) AND STATUS WAS NOT IN (DONE, BACKLOG)
ON '2023-01-18' AND CREATED < '2023-01-18' ORDER BY CREATED DESC
Query2: In valid status ready for the team to work
PROJECT IN (PPC, CATR, DET,BIA) AND FIXVERSION IN (DEVAS)
and ISSUETYPE IN (Story, Bug)
AND STATUS WAS IN ('To Do', 'In Progress', 'In QA', 'ON HOLD/BLOCK', Completed)
ON '2023-01-18' AND CREATED < '2023-01-18' ORDER BY CREATED DESC
Here is the result for the Query1:

Here is the result for Query2:

As you can see the total count is not the same, but not just that, there are 10 issues in Query1 not in Query2 result and 6 issues in Query2 not in Query1 result.
As a workaround I was trying to combine both conditions in an OR statement, but I am not getting the expected result.
PROJECT IN (PPC, CATR, DET,BIA) AND FIXVERSION IN (Devas)
and ISSUETYPE IN (Story, Bug) AND (
(STATUS WAS NOT IN (DONE, BACKLOG) ON '2023-01-18')
OR (STATUS WAS IN ('To Do', 'In Progress', 'In QA', 'ON HOLD/BLOCK', Completed) ON '2023-01-18')
) AND CREATED < '2023-01-18' ORDER BY CREATED DESC
I get the counts of Query1 and if I put the Query2 first, then the count of the second one.
Am I doing something wrong here, or is it a bug, if so has it being reported?
Thanks,
David