3

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

4

1 回答 1

3

可以将 'in' 运算符与SnapshotStore一起使用,它从 Lookback API 检索数据,如下例所示,其中 1111 和 2222 是主题类型的 PortfolioItems 的 OID:

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

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

'in' 运算符是特定于 LBAPI 的。在Rally.data.QueryFilter的配置选项中,有一个有效运算符列表,它不包括“in”。

于 2013-08-10T17:00:53.790 回答