I don't know how to specify a query filter that will limit by Iteration. Using the following code, I'm trying to get only the user stories within an iteration for a project...
QueryRequest query = new QueryRequest("HierarchicalRequirement");
query.setFetch(new Fetch("Name", "FormattedID", "Description", "Iteration", "PortfolioItem"));query.setPageSize(pageSize);
query.setLimit(20);query.setScopedDown(false);query.setScopedUp(false);query.setProject(parms.getProjectURL()); query.setQueryFilter(new QueryFilter("Iteration._refObjectName", "=", parms.getIteration()));
QueryResponse featureSet = restApi.query(query);
Response is unsuccessful, with the result:
Could not parse: Attribute "_refObjectName" on type Iteration is not allowed in query expressions.
query.setQueryFilter(new QueryFilter("Iteration.Name", "=", parms.getIteration()));
The _ attributes are a kind of "stub" attribute that we use to give hints on child objects about what an object is before you dig into it. I've never been able to really query on them though.
David, It worked You can use
storyRequest.setQueryFilter(new QueryFilter("Iteration.Name", "=", parms.getIteration()));
to limit by iteration.