我正在使用java代码来获取给定项目的所有用户文件。
QueryRequest hrRequest = new QueryRequest("hierarchicalrequirement");
hrRequest.setFetch(new Fetch("Name","Children","Release"));
hrRequest.setWorkspace(wsRef);
hrRequest.setProject(prjRef);
上面的代码将为我提供与迭代相关的所有用户事项(即,如果迭代为空白 - 这将不会获取该用户)
但是,我需要获取在该项目/子项目下可用的所有用户文件
请帮忙
由于 VG
答案 0 :(得分:0)
您可以设置请求的项目范围:
storyRequest.setProject(projectRef);
只要在指定projectRef之前:
String projectRef = "/project/2222";
这是一个打印项目中故事计数的代码:
public class aRESTstories {
public static void main(String[] args) throws URISyntaxException, IOException {
String host = "https://rally1.rallydev.com";
String username = "apiuser@company.com";
String password = "secret";
String projectRef = "/project/2222";
String workspaceRef = "/workspace/11111";
String applicationName = "RESTExampleStoriesInProject";
RallyRestApi restApi = new RallyRestApi(
new URI(host),
username,
password);
restApi.setApplicationName(applicationName);
QueryRequest storyRequest = new QueryRequest("HierarchicalRequirement");
storyRequest.setLimit(1000);
storyRequest.setScopedDown(true);
storyRequest.setScopedUp(false);
storyRequest.setWorkspace(workspaceRef);
storyRequest.setProject(projectRef);
QueryResponse storyQueryResponse = restApi.query(storyRequest);
System.out.println(storyQueryResponse.getResults().size());
}
}