1

I am working to create an RPM tree that can be used to select leaf stories from different levels of the RPM hierarchy.

I was able to get close to the desired functionality by using the method described here, however there appear to be some inconsistencies in the number of leaf stories being returned at each level of the RPM.

The following Image shows the tree (Project names covered for privacy purposes). The yellow badges show the number of leaf stories found below that level of the RPM hierarchy. As you can see from the image, the numbers are inconsistent. (Below the Initiative shows 23 leaf stories and below one of the Rollups shows 44.) There are in fact 44 leaf stories below that Rollup so the problem appears to be from querying at the Initiative level.

enter image description here

Here is the function I wrote which is intended to return an array of all the OIDs for leaf stories below the selected RPM node:

                   function getDescendants(OID, callback) {
                        Ext.create('Rally.data.lookback.SnapshotStore', {
                            autoLoad: true,
                            pageSize: 1000000,
                            fetch: ['ObjectID'],
                            filters: [
                                { property: '_ItemHierarchy', value: OID                       },
                                { property: 'Children',       value: null                      },
                                { property: '__At',           value: new Date().toISOString()  },
                                { property: '_TypeHierarchy', value: 'HierarchicalRequirement' }
                            ],
                            listeners: {
                                load: function(model, data, success) {
                                    if (data && data.length && success) {
                                        var descendants = [];
                                        Ext.Array.each(data, function(story) {
                                            descendants.push(story.get('ObjectID'));
                                        });
                                        callback(Ext.Array.unique(descendants));
                                    } else {
                                        callback([]);
                                    }
                                }
                            }
                        });
                    }
4

1 回答 1

2

这个查询对我来说是正确的。我认为您遇到了存在于 Lookback API 的数据流中的已知缺陷。流中的问题已得到纠正,但返回并纠正错误历史的工作仍在团队积压中。如果您想通过 Support 跟踪其进度,该缺陷的 ID 为 DE15647。

解决方法(因为您只查询当前数据)是取消父级和重新父级受影响的项目。

对不起。

编辑:有关该问题的更多详细信息 - 在一段时间内,每当创建 PortfolioItem(策略、主题、功能、倡议)并同时设置其父级时,Lookback API 服务都不会收到通知新 PortfolioItem 的父级。现在这个问题已经解决了,但是旧数据还有待修复。您可以通过在该 _ItemHierarchy 中查找具有 null Parent 字段的 PI 来搜索可能存在此问题的 PI。

要获得具有 null 父母(潜在孤儿)的 PI​​:

fetch: ['ObjectID', '_ValidFrom', '_ValidTo'],
filters: [
    { property: '_ItemHierarchy', value: OID }, // only include this if you're limiting to a sub-hierarchy
    { property: '_TypeHierarchy', value: 'PortfolioItem' },
    { property: 'Parent', value: null },
    { property: '__At', value: 'current' }
]

对于这些“孤儿”中的每一个,检查其作为孩子的父母:

fetch: ['ObjectID'],
filters: [
    { property: 'Children', value: currentChild.ObjectID },
    { property: '_TypeHierarchy', value: 'PortfolioItem' },
    { property: '_ValidFrom', operator: '<=' value: currentChild._ValidFrom.toISOString() },
    { property: '_ValidTo', operator: '>' value: currentChild._ValidFrom.toISOString() }
]

对于每一个,如果您找到一个声称孩子的父母(在创建孩子时),您知道您有一个受此问题影响的快照,并且可以通过在 ALM 中清除其父母,保存,然后重置它来修复它父母并再次保存。我在第一次检查中包括了 __At: 'current',因为孤立的 PI 有可能稍后分配了不同的父级,而您不想覆盖它。希望这可以帮助。

于 2013-01-09T20:50:53.363 回答