rally lookback is lowest portfolio Item an indexed field?

114 Views Asked by At

The lookback api docs say PortfolioItem field is an index. Is the lowest portfolio item type also an index?

E.g: the Portfolio Item types in my workspace are Product, Milestone and Feature. will Feature be an index in Lookback API in addition to PortfolioItem?

The reason I ask is because only top-level UserStories have the PortfolioItem field, but both top-level and child UserStories have the Feature field. I want to query all User Stories under a particular Feature, which means I can't use PortfolioItem field, because it will not include child User Stories, only top-level User Stories.

Example of what i want to do if Feature is indexed:

    Ext.create('Rally.data.lookback.SnapshotStore', {
        listeners: {
            load: function(store, data, success) {
                //do stuff
            }
        },
        autoLoad:true,
        limit:Infinity,
        fetch: ['ScheduleState', 'PlanEstimate', 'Feature', 'ObjectID'],
        compress:true,
        find: { 
            _TypeHierarchy: 'HierarchicalRequirement', 
            Children: null,
            Release: //a release OID
        },
        hydrate: ['ScheduleState']
    });
2

There are 2 best solutions below

1
Joel Sherriff On BEST ANSWER

There may be some confusion with the use of the word 'index'. Some fields are "indexed" for fast lookup..."Feature" isn't one of them, though it is a valid field and you can search for it. More correctly, the field that is the lowest-level Portfolio Item type is kept in the snapshots.* Given what you're asking for, adding "Feature": {oid} to the find should give you what you want.

* The distinction is due to the fact that the label "Feature" can be changed to something else, so what is "Feature" in one workspace might be "Thing" in another.

5
Larry Maccherone On

The _ItemHierarchy field includes all levels of PortfolioItems through all levels of Stories to Defects, Tasks and (I'm pretty sure) TestCases. So, if you want "all User Stories under a particular Feature", simply specify find: {_ItemHierarchy: 1234567} where 1234567 is the ObjectID of the Feature. You could combine this with the _TypeHierarchy and Release clauses. If you combine it with the Children and _TypeHiearchy clauses as you proposes, that will give you only leaf stories as opposed to all the levels. This is ideal if you are doing aggregations on fields like sum of PlanEstimate (points) or TaskActual, etc.

Note, I don't think this has anything to do with being indexed, so I may be misunderstanding your question. Please accept my apology if that's the case.