我不知道如何与SOAP但与REST API很简单做到这一点: http://developer.rallydev.com/help/java-toolkit-rally-rest-api
RallyRestApi restApi = new RallyRestApi(new URI("https://rally1.rallydev.com"),
"[email protected]", "password");
QueryRequest stories = new QueryRequest("hierarchicalrequirement");
stories.setFetch(new Fetch("FormattedID", "Name", "ScheduleState"));
stories.setOrder("Iteration.EndDate DESC,Rank DESC");
QueryResponse queryResponse = restApi.query(stories);
if (queryResponse.wasSuccessful()) {
for (JsonElement result : queryResponse.getResults()) {
JsonObject story = result.getAsJsonObject();
System.out.println(String.format("\t%s - %s: ScheduleState=%s",
story.get("FormattedID").getAsString(),
story.get("Name").getAsString(),
story.get("ScheduleState").getAsString()));
}
}
没错,问题是上阶条件。 “Iteration.EndDate DESC,Rank DESC”不起作用! “Rank DESC”起作用,但不适用“Iteration.EndDate DESC”部分 – klebe85
显然,WSAPI不能对子字段进行排序,例如Iteration.EndDate。相反,您必须按结束日期查询迭代,然后针对该排序中按故事排序的故事中的每个查询。我们仍然推荐使用REST over SOAP :-) –