Rally Software

Expand all | Collapse all

Trying to get User Stories within Project and Iteration

Jump to Best Answer
  • 1.  Trying to get User Stories within Project and Iteration

    Posted 01-04-2019 03:37 PM

    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.



  • 2.  Re: Trying to get User Stories within Project and Iteration
    Best Answer

    Broadcom Employee
    Posted 01-04-2019 04:24 PM

    Try this:

    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.



  • 3.  Re: Trying to get User Stories within Project and Iteration

    Posted 01-07-2019 02:03 PM

    David,  It worked  You can use

     

     storyRequest.setQueryFilter(new QueryFilter("Iteration.Name", "=", parms.getIteration()));

     

    to limit by iteration.