我想获取项目的修订历史记录。我想找到包含修订说明的项目,如"父级更改自"及其最后更新日期。我尝试了以下代码,它抛出了空指针异常。此代码中使用的查询是否正确?请帮忙。
try {
QueryRequest projectRequest = new QueryRequest("Project");
projectRequest.setFetch(new Fetch("Name", "Revisions", "LastUpdateDate"));
projectRequest.setWorkspace(workspaceRef);
projectRequest.setProject(projectRef);
projectRequest.setScopedDown(true);
//projectRequest.setQueryFilter(new QueryFilter("Name", "contains", "PARENT changed from"));
projectRequest.setLimit(queryLimit);
QueryResponse projectQueryResponse = restApi.query(projectRequest);
int count = projectQueryResponse.getResults().size();
System.out.println(count);
if (count > 0) {
for (int i = 0; i < count; i++) {
JsonObject projectObject = projectQueryResponse.getResults().get(i).getAsJsonObject();
System.out.println("Project: " + projectObject.get("_refObjectName"));
// int numberOfRevisions = projectObject.getAsJsonObject("RevisionHistory").get("Count").getAsInt();
// if(numberOfRevisions > 0) {
QueryRequest revRequest = new QueryRequest(projectObject.getAsJsonObject("Revisions"));
System.out.println (restApi.query(revRequest).getResults());
JsonObject revhistory = restApi.query(revRequest).getResults();
for (int j=0;j<numberOfRevisions;j++){
//System.out.println(revhistory.get(j).getAsJsonObject().get("_refObjectName").getAsString());
}
}
}
}
谢谢
斯里
不幸的是,
Rally Projects 的 RevisionHistory 集合无法通过 Web 服务 API 获得。它可用于工作区。
我已将其作为缺陷提交给拉力工程。如果您希望收到有关该问题的更新,则可能希望向 Rally 支持提交案例,包括在修复可能可用时发出通知。目前没有修复时间估计。