gpt4 book ai didi

java - Rally:给定项目的 UserStory 计数

转载 作者:行者123 更新时间:2023-12-01 04:30:59 25 4
gpt4 key购买 nike

我正在编写java代码来获取给定项目的所有用户故事。

    QueryRequest hrRequest = new QueryRequest("hierarchicalrequirement");
hrRequest.setFetch(new Fetch("Name","Children","Release"));
hrRequest.setWorkspace(wsRef);
hrRequest.setProject(prjRef);

上面的代码将为我提供与迭代相关的所有用户故事(即,如果迭代为空 - 这将不会获取该用户故事)

但是,我需要获取该项目/子项目下可用的所有用户故事

请帮忙

谢谢VG

最佳答案

您可以设置您的请求的项目范围:

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());
}
}

关于java - Rally:给定项目的 UserStory 计数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17980028/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com