Rally waspi queries - filter using 'in' operator

672 views Asked by At

I was trying to get all of the user stories associated with a given rollup by querying first for the features that have that rollup as their parent, and then finding all of the stories that have that feature as their PortfolioItem parent.

However, this requires some messy looping in order to loop over all of the features to get their children. I have been using multiple WSAPI data stores for my queries, and I want to use some of the syntax from the lbapi queries - particularly, can you use the 'in' value as an operator? I tried doing that with an array of ids supplied, but it did not appear to work. I would be much more elegant (and easier) to do something like

filters : [{
    property : 'Parent.ObjectID',
    operator : 'in',
    value    : ids
}]

rather than

Ext.Array.each(ids, function(id) {
    ...
    filters : [{
        property : 'Parent.ObjectID',
        operator : '=',
        value    : id
    }]

Or is this unique to the LBAPI? Am I going about this in entirely the wrong way? Thanks

1

There are 1 answers

0
nickm On BEST ANSWER

It is possible to use 'in' operator with a SnapshotStore,which retrieves data from Lookback API, as in the example below, where 1111 and 2222 are OIDs of PortfolioItems of type Theme:

Ext.create('Rally.data.lookback.SnapshotStore', {
                        context: {
                            workspace: this.context.getWorkspace(),

                        },
                         find: '{'+' "_ItemHierarchy":{$in:[1111,2222]},'+
                                    '"_TypeHierarchy":"HierarchicalRequirement"'+'}',
                        //...........

'in' operator is specifc to LBAPI. In config options of Rally.data.QueryFilter there is a list of valid operators, and it does not include 'in'.