Question

I am trying to get those user stories that have parent of type feature. Here's my code:

QueryRequest request = new QueryRequest("HierarchicalRequirement");
request.setFetch(new Fetch("Name,FormattedID, Parent, Feature"));
request.setQueryFilter(new QueryFilter("Feature.FormattedID","=","F1119").and(new QueryFilter("Parent._type","=","PortfolioItem/Feature")));
QueryResponse response = this.rest.query(request);
if(response.wasSuccessful()){
....
}

The response returned is valid when I remove the Parent Type filter. I get those stories that have Feature F119 . For some reason, when I explore the top level story in Rally, I can see that it has a parent Feature, but the Parent returned via query is null.

No stories are returned when I add Parent Type Query filter .

Was it helpful?

Solution

Per WS API object model a HierarchiclaRequirement object has Parent attribute that points to another HierarchiclaRequirement (a Parent story), a Feature attribute that references PI/Feature object that could be either its direct PI/Feature parent or the parent of it's parent user story, and a PortfolioItem attribute that points to its immediate PI/Feature parent

Given this scenario and hierarchiclarequirement queries below: US1 parent story and US2 child story, and the PI/Feature "parent" of US1 is F1:

(PortfolioItem.FormattedID = F1) 

returns US1 that has a parent Feature. It does not return US2.

(Feature.FormattedID = F1)

returns both the epic and it's child, US1 and US2.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top