문제

I would like to get the Revision History for Project. I want to find the Project which contains the Revision Description as "PARENT changed from" and its LastUpdateddate .I tried the following code, it threw Null Pointer exception. Was my Query used in this code correct? Please help.

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

Thanks

Sree

도움이 되었습니까?

해결책

Unfortunately the RevisionHistory collection for Rally Projects is not available through Webservices API. It is available for Workspaces.

I have filed this as a Defect with Rally Engineering. You may wish to file a case with Rally Support if you wish to receive updates on the issue, including a notification at such time as a fix may become available. There's no time estimate on a fix at this time.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top