There is currently no direct way to get testcases from subfolders, but here is a way to do it in 2 steps:
POST /api/v1/graph/visit
{
"template": "tcf-nested",
"ids": [1234],
"projectId": 1
}
This runs a pre-defined graph query to retrieve the nested testcase folder ids (This endpoint is currently not yet documented but you can assume it to be stable)
take the result.ids array from this response, add your original folder id (if needed - the result does not include the root itself)
and use the array in your query instead of the “ids: {…}” line use "filter": { "testcase_folder_id": [1234,1235,1237,1238] }
We are aware that our API docs could use improvements and are working on adding more documentation and more examples. We are also considering adding easier-to-use endpoints for common use cases.
testcase_folder_id is the array of IDs from previous mentioned request.
400 - Validation failed because no alternatives match: ‘Expected number at DataReadParams.map.ids.testcase_folder_id, Expected null at DataReadParams.map.ids.testcase_folder_id’ at DataReadParams.map.ids.testcase_folder_id
Clearly something missing in what I’m allowed to pass into the filter and map here?
In the meantime, there is an improved way of filtering for folders including all subfolders with the “in_subtree” operator. E.g. the following find parameters will give you all test cases in the folder with ID testcase_folder_id including in all subfolders: