Rally Project使用JAVA API修订历史记录

时间:2014-04-08 07:27:00

标签: java api rally revision-history

我想获得项目的修订历史记录。我想找到包含修订版描述的项目为“ PARENT已从更改”及其 LastUpdateddate 。我尝试了以下代码,它抛出了Null Pointer异常。我的查询在此代码中的使用是否正确?请帮忙。

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

由于

SREE

1 个答案:

答案 0 :(得分:0)

遗憾的是,Rally Projects的RevisionHistory集合无法通过Webservices API获得。它适用于工作区。

我已将此作为拉力工程的缺陷提交。如果您希望收到有关该问题的最新信息,您可能希望file a case with Rally Support,包括在修复程序可用时发出通知。目前没有时间估计修复。