Reputation: 11
How do I get a list of milestones associated with a project ID using the Rest API Java toolkit?
Upvotes: 0
Views: 467
Reputation: 341
Since it seems you know the Project ID, query for Milestone where the Projects Object contains that ID:
RallyRestApi restApi = new RallyRestApi(new URI("https://rally1.rallydev.com"), "_ApIk3y");
QueryRequest request = new QueryRequest("Milestone");
request.setQueryFilter(new QueryFilter("Projects", "contains", "/project/<YOUR PROJECT ID>"));
QueryResponse response = restApi.query(request);
if (response.wasSuccessful() && response.getResults().size() > 0) {
System.out.println(response.getResults().get(0).getAsJsonObject());
}
Upvotes: 1