AnsweredAssumed Answered

In Rally, Using Java REST API, How to get the complete list of test cases present in all sub-folders of a TestPlan folder?

Question asked by ganma05 Employee on Jul 5, 2018
Latest reply on Jul 25, 2018 by Michael Bulkeley

In query filter, i have tried with FormattedID, TestFolder.Parent.Name, TestFolder.Name. But could not get the test cases of all sub folders.

Here TestFolderID can be a TestPlan folder name OR any parent folder with subfolders.

With below code, I am getting only the test cases directly present in the folder, but not from all subfolders of a given folder name. 

            

TestFolderID="TF27980";   
QueryRequest queryRequest = new QueryRequest("TestCases");            
queryRequest.setFetch(new Fetch(new String[] {"Name", "TestCases","FormattedID","TestFolder"}));             
queryRequest.setWorkspace(workspaceRef.get());            
queryRequest.setQueryFilter(new QueryFilter("TestFolder.Parent.Name", "=",  TestFolderID) );             
queryRequest.setScopedDown(true);            
queryRequest.setLimit(Integer.MAX_VALUE);            
queryRequest.setPageSize(Integer.MAX_VALUE);             
QueryResponse queryResponse = null;            
JsonArray jsonarr = new JsonArray();            
queryResponse = restApi.get().query(queryRequest);            
int responseTotalResultsCount = queryResponse.getTotalResultCount

Outcomes