Rally: Java: I have few test folders inside a test folder and all folders have test cases. How to get all the test cases using java api

你说的曾经没有我的故事 提交于 2019-12-06 04:32:18

In this case you could add another clause to your query to account for the grandparent case:

QueryFilter children = new QueryFilter("TestFolder.Name", "=", "TestFolderParent1");
QueryFilter grandChildren = new QueryFilter("TestFolder.Parent.Name", "=", "TestFolderParent1");
testSetRequest.setQueryFilter(children.Or(grandChildren));

This gets clumsy pretty quickly if you have a super deep hierarchy of test folders but should work alright for the case you have mentioned...

Tanveer

Your code is good enough but slight modification will fetch your required results. TestFolder.Parent.Name will fetch you all test cases from that particular folder irrespective of number of child folders.

QueryRequest testSetRequest = new QueryRequest("TestCases");
testSetRequest.setFetch(new Fetch(new String[] { "Name","FormattedID"}));
testSetRequest.setQueryFilter(new QueryFilter("TestFolder.Parent.Name", "=", "TestFolderParent1"));
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!