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

API: Subsections are not included in get test cases from a section

Hey folks! I am trying to get all the test cases from a section. If I use the API for a simple section it returns the test case’s info, but if the section has subsection it returns empty.

How can I get all the test cases that are included in a nested section?

Example section 26 has subsection (only has subsections)
GET /index.php?/api/v2/get_cases/1&section_id=26 and it returns <Empty JSON content> If the section only has test cases it returs the info

I think that subsection should be included on get test cases from the section, at least the id of the subsection.

Thanks

PD: My main goal is to create by API a test run from a test case section. It should be great if we could create a test run from a section id, included all subsections

Hi Veronica,
get_cases just returns a flat list of cases. You have to use get_sections to retrieve all sections first an provide the optional section id at get_cases. Unfortunately you have to take care abut the hierarchy by yourself.

Because I use Java model classes, I create the object tree of cases myself, either for the whole suite or any given section with it’s subsections. Would be nice to have a standard endpoint for it, but I wasn’t able to find one myself too.

I think you have to invest a little extra effort in it. :thinking:

Karsten

1 Like

Thanks @kwirth!
I find the same workaround, but as you said I would be wonderfull have an endpoint for that.

If I find something else, I will let you know.

Thanks for your time!