Rally 水合物目标场

Rally 水合物目标场,rally,appsdk2,lookbackapi,Rally,Appsdk2,Lookbackapi,我想获取从回溯API获得的用户故事的功能对象。 但当我尝试创建一个功能时,我只得到未格式化的功能ID 我可以从回溯结果集中获取用户故事的真实要素对象吗 下面是我用于检索数据的代码示例: storeConfig: { find: { "_TypeHierarchy": { '$in' : [-51038] }, "Children": null }, fetch:

我想获取从回溯API获得的用户故事的功能对象。 但当我尝试创建一个功能时,我只得到未格式化的功能ID

我可以从回溯结果集中获取用户故事的真实要素对象吗

下面是我用于检索数据的代码示例:

storeConfig: {
            find: {
                "_TypeHierarchy": { '$in' : [-51038] },
                "Children": null
            },
            fetch: ["ScheduleState", "PlanEstimate", "ObjectID", "_ValidFrom", "_ValidTo", "c_BaselineDeliveryConfidence", "Name", "Feature"],
            hydrate: ["ScheduleState", "c_BaselineDeliveryConfidence", "Name", "Feature"],
            sort: {
                "_ValidFrom": 1
            },
            compress: true,
            useHttpPost: true

Feature是用户故事引用的完整对象(通过Feature属性)。 与此查询类似的代码:

https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/111/artifact/snapshot/query.js?find={"_TypeHierarchy":"HierarchicalRequirement"}&fields=["Name","ScheduleState","PlanEstimate","Feature"]&hydrate=["ScheduleState"]
将返回如下内容:

{
Feature: 12483739639,
Name: "my story",
ScheduleState: "Defined",
PlanEstimate: 3
}
其中12483739639是特征的ObjectID。向水合物中添加“特征”不会产生任何影响


如果要获取完整的要素对象或其某些属性,可以在代码中使用要素的OID并发出单独的查询。您还可以将这些OID推入数组,并在第二个查询中使用
$in
运算符

不可能直接从LBAPI中将物体水合。然而,我一直在开发一个helper类来实现这一点,使用了一种类似于Nick建议的方法

下面是一个如何使用它的示例。我正在收集所有的leaf用户故事(有一个迭代任务),然后补充该倡议领域:

launch: function() {
    var self = this;
    Ext.create('Rally.data.lookback.SnapshotStore', {
        limit   : Infinity,
        fetch   : ['Name','Iteration'],
        filters : [{
            property : '__At',
            value    : 'current'
        },{
            property : '_TypeHierarchy',
            value    : 'HierarchicalRequirement'
        },{
            property : 'Iteration',
            operator : '!=',
            value    : null
        },{
            property : 'Children',
            value    : null
        }]
    }).load({
        params : {
            compress                    : true,
            removeUnauthorizedSnapshots : true
        },
        callback : function(records, operation, success) {
            self._hydrateRecords(records);
        }
    });
},

_hydrateRecords: function(records) {
    Ext.create('CustomApp.RecordHydrator', {
        fields: [{
            name    : 'Iteration',
            hydrate : ['Name','StartDate','EndDate']
        }]
    }).hydrate(records).then({
        success: function(hydratedRecords) {
            console.log(_.groupBy(hydratedRecords, function(record) {
                return record.get('Iteration') && record.get('Iteration').get('Name');
            }));
        }
    });
}