0
我試着讀討論從用戶故事通過拉力REST API討論在用戶故事
RallyRestApi restApi = new RallyRestApi(new URI(rallyURL), userName, userPassword);
restApi.setApplicationName("QueryExample");
try
{
QueryRequest storyRequest = new QueryRequest("HierarchicalRequirement");
storyRequest.setFetch(new Fetch("Name", "Owner", "UserName", "EmailAddress", "Discussion"));
storyRequest.setLimit(1000);
storyRequest.setScopedDown(false);
storyRequest.setScopedUp(false);
storyRequest.setWorkspace(workspaceRef);
storyRequest.setProject(projectRef);
storyRequest.setQueryFilter(new QueryFilter("FormattedID", "=", "US4"));
QueryResponse storyQueryResponse = restApi.query(storyRequest);
JsonObject storyJsonObject = storyQueryResponse.getResults().get(0).getAsJsonObject();
System.out.println("Name: " + storyJsonObject.get("Name"));
JsonObject userObject = storyJsonObject.get("Owner").getAsJsonObject().getAsJsonObject();
System.out.println(userObject.get("UserName"));
System.out.println(userObject.get("EmailAddress"));
System.out.println(userObject.get("Discussion"));
}
finally
{
//Release resources
restApi.close();
}
討論爲NULL。
如何通過REST API讀取和編寫用戶故事討論?
WBR,斯拉瓦
感謝您的幫助。但我有一個錯誤..我編輯你的答案 –
@VyacheslavYanyuk不編輯帖子來報告他們的問題 - 添加問題作爲評論,以便它可以在答案中解決! – codeling
我沒有看到編輯,並驗證它正在工作。爲了使它適合你,你需要糾正什麼? – nickm