RallyRestApi restApi = new RallyRestApi(new URI("https://rally1.rallydev.com"), "user@company.com", "password"); //retrieve only 1 QueryRequest defectCount = new QueryRequest("defect"); defects.setPageSize(1); defects.setLimit(1); //for a specific project defectCount.setProject("/project/12345"); defectCount.setScopedUp(false); defectCount.setScopedDown(false); QueryResponse defectCountResponse = restApi.query(defectCount); int total = defectCountResponse.getTotalResultCount();
String projectRef = "/project/3456"; QueryRequest defectRequest = new QueryRequest("Defect"); defectRequest.setProject(projectRef); defectRequest.setScopedDown(true); defectRequest.setScopedUp(false);
QueryRequest defectRequest = new QueryRequest("defect"); defectRequest.setFetch(new Fetch("Project", "LastUpdateDate", "FormattedId", "SubmittedBy", "Owner")); defectRequest.setProject("/project/12345"); //The project oid for your project defectRequest.setScopedDown(true); QueryResponse projectDefects = rallyApi.query(defectRequest);
try { restApi = new RallyRestApi( new URI(host), username, password); restApi.setApplicationName(applicationName); QueryRequest defectRequest = new QueryRequest("Defect"); defectRequest.setProject(projectRef); defectRequest.setFetch(new Fetch(new String[] {"Name", "FormattedID","State", "Priority", "Severity", "Requirement"})); defectRequest.setLimit(1000); defectRequest.setScopedDown(false); defectRequest.setScopedUp(false); defectRequest.setQueryFilter(new QueryFilter("Requirement", "=", storyRef)); QueryResponse defectQueryResponse = restApi.query(defectRequest); for (int i=0; i<defectQueryResponse.getResults().size();i++){ JsonObject defectJsonObject = defectQueryResponse.getResults().get(i).getAsJsonObject(); System.out.println("Name: " + defectJsonObject.get("Name") + " State: " + defectJsonObject.get("State") + " Priority: " + defectJsonObject.get("Priority") + " FormattedID: " + defectJsonObject.get("Requirement")); } } finally { if (restApi != null) { restApi.close(); } }
taskRequest.setFetch(new Fetch("Name","FormattedID","Iteration","Project")); taskRequest.setLimit(1000); taskRequest.setScopedDown(true); taskRequest.setScopedUp(false); taskRequest.setWorkspace(workspaceRef);
testCaseRequest.setQueryFilter(new QueryFilter("FormattedID", "=", "TC3")); testCaseRequest.setScopedDown(false); testCaseRequest.setScopedUp(false);
storyRequest.setFetch(new Fetch(new String[] {"Name", "FormattedID", "Tags", "Children"})); storyRequest.setLimit(1000); storyRequest.setScopedDown(false); storyRequest.setScopedUp(false);
storyRequest.setFetch(new Fetch("Name","Owner","UserName","PlanEstimate","Discussion","ConversationPost","Text")); storyRequest.setLimit(1000); storyRequest.setScopedDown(false); storyRequest.setScopedUp(false); storyRequest.setWorkspace(workspaceRef);
storyRequest.setFetch(new Fetch(new String[] {"Name", "FormattedID", "ScheduleState", "State", "PlanEstimate", "TaskRemainingTotal", "CreationDate"})); storyRequest.setLimit(1000); storyRequest.setScopedDown(false); storyRequest.setScopedUp(false); storyRequest.setQueryFilter((new QueryFilter("Project.Name", "=", "Demandware")).and(new QueryFilter("Release.Name", "=", "201311 IT Integrated Release")));
storyRequest.setFetch(new Fetch("Name","Owner","UserName", "EmailAddress")); storyRequest.setLimit(1000); storyRequest.setScopedDown(false); storyRequest.setScopedUp(false); storyRequest.setWorkspace(workspaceRef);
request.setScopedDown(false); request.setScopedUp(false);
testCaseRequest.setScopedDown(false); testCaseRequest.setScopedUp(false);
RallyRestApi restApi = new RallyRestApi(new URI("https://rally.rallydev.com/"), "_apogjlfdkjglfjlksr23rfdlj"); String wsapiVersion = "v2.0"; String workspaceRef = "/workspace/01245"; String projectRef = "/project/6757552"; if(restApi!=null){ restApi.setWsapiVersion(wsapiVersion); QueryRequest queryRequest = new QueryRequest("TestFolders"); queryRequest.setFetch(new Fetch(new String[] { "Name","FormattedID","TestFolder"})); queryRequest.setWorkspace(workspaceRef); queryRequest.setProject(projectRef); queryRequest.setScopedDown(true); queryRequest.setLimit(Integer.MAX_VALUE); queryRequest.setPageSize(Integer.MAX_VALUE); QueryResponse queryResponse = null; JsonArray jsonarr = new JsonArray(); queryResponse = restApi.query(queryRequest); int responseTotalResultsCount = queryResponse.getTotalResultCount(); jsonarr.addAll(queryResponse.getResults()); int jsonArrSize = jsonarr.size(); for (int i=0; i<queryResponse.getResults().size();i++){ JsonObject testCaseJsonObject = queryResponse.getResults().get(i).getAsJsonObject(); System.out.println(testCaseJsonObject.getAsJsonObject().get("FormattedID")+": "+testCaseJsonObject.getAsJsonObject().get("Name")); } }
storyRequest.setScopedDown(true); storyRequest.setScopedUp(false); storyRequest.setWorkspace(workspaceRef);
releaseRequest.setScopedDown(false); releaseRequest.setScopedUp(false); releaseRequest.setProject(projectRef); iterationRequest.setScopedDown(false); iterationRequest.setScopedUp(false); iterationRequest.setProject(projectRef); storyRequest.setFetch(new Fetch(new String[] {"Name", "FormattedID","ScheduleState"})); storyRequest.setLimit(1000); storyRequest.setScopedDown(false); storyRequest.setScopedUp(false); storyRequest.setQueryFilter(new QueryFilter("Iteration.Name", "=", iterationName));