Jag
Jag

Reputation: 11

Fetching Milestone List for an Agile Central Project ID using Rest API Java toolkit

How do I get a list of milestones associated with a project ID using the Rest API Java toolkit?

Upvotes: 0

Views: 467

Answers (1)

Michael B
Michael B

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

Related Questions