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

How to get_cases from section with API?


#1

I’m able to get the entire test cases for my project via the api with:
https://d3banking.testrail.com/index.php?/api/v2/get_cases/4
where project_id = 4.

I would like to just get the test cases for a section in the project and tried both of the following:
https://d3banking.testrail.com/index.php?/api/v2/get_cases/4&suite_id=4&section_id=444
and
https://d3banking.testrail.com/index.php?/api/v2/get_cases/4&section_id=444

where section_id is the section_ID I want.

The result set is empty. My project is a single repository, but I thought I should be able to filter by section.

Please advise.


#2

I think my problem is the section I’m invoking does not have any test cases, but the child sections under it do. I would have thought the parent section in the API call would provide the child cases as well. Is this not the case? Is there a way to get the child cases?


#3

You could use the get_sections API call to find all the child sections (i.e. where parent_id=444) and loop through those to get all their sections and/or cases.


#4

Hello all,

get_cases/:section_id

returns only the cases for this particular section and you can use get_sections to get a list of all sections (like Don already said, thanks!).

Regards,
Tobias