Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Confused about deleted Test Cases


#1

Hi,

I’ve written some SQL that returns all Cases where the value of one custom field is “x” and the value of another field is “y” for a given project.

The results contain a number of Case IDs that cannot be found when searching via the TestRail UI. When I enter the C#, it says:

The specified test case was not found.

I’m assuming that these Cases have been deleted, but they still exist in the Cases table. Is there another table or field somewhere that prevents Cases from being searched or shown in the UI?

I just need to understand to a.) make sure nothing has gone wrong and b.) ensure these can be excluded from my results.

Thanks.


#2

Hello Bryan,

Thanks for your posting. You would need to make sure that internal test case copies are not included in the results and this can be done via the is_copy field:

Test case copies are used internally to implement the close feature for test runs.

Regards,
Tobias


#3

Thanks Tobias,

I’m afraid I didn’t quite understand that though, sorry. The SQL I have is:

select c.id, u.name, c.milestone_id, c.refs from cases c, suites s, projects p, users u where c.suite_id = s.id and s.project_id = p.id and p.id = 2 and c.refs is not null and c.milestone_id is null and c.user_id = u.id

It returns only a handful of results; with 5 of them I believe to be deleted because I cannot search for them.

I’ve looked at the is_copy field and can’t quite see how that works.

Could you show what other where clause(s) are needed to exclude the deleted ones?

Thanks!


#4

Hello Bryan,

Thanks for the update. You can filter out the internal test case copies as follows:

.. and c.is_copy = 0

Regards,
Tobias