1

我如何确定某样东西在某个州停留了多长时间?这是我为提取用户故事的细节而提出的一个查询,但我试图了解如何在完成之前获得在进行中所花费的持续时间。更具体地说,自定义周期时间

https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/xxxx/artifact/snapshot/query.js?find= {"FormattedID":"US41","_PreviousValues.ScheduleState":"进行中"}&fields=["ScheduleState","_ValidFrom","_ValidTo","_PreviousValues"]&hydra=["ScheduleState","_ValidFrom","_ValidTo","_PreviousValues"]&sort={_ValidFrom: -1 }&页面大小=1

我看不到 ValidFrom 和 ValidTo 在哪里提供该信息。

4

1 回答 1

1

这个解决方案似乎对我有用。希望能帮助到你!

Ext.define('CustomApp', {
    extend: 'Rally.app.App',
    componentCls: 'app',

    launch: function() {
        Ext.create('Rally.data.lookback.SnapshotStore', {
            fetch   : ['ScheduleState'],
            hydrate : ['ScheduleState'],
            filters : [{
                property : '_UnformattedID',
                value    : 41
            }],
            sorters : [{
                property  : '_ValidTo',
                direction : 'ASC'
            }]
        }).load({
            params : {
                compress                    : true,
                removeUnauthorizedSnapshots : true
            },
            callback : function(records, operation, success) {
                var cycleTime = Rally.util.DateTime.getDifference(new Date(Rally.util.Array.last(Ext.Array.filter(records, function(record) {
                    return record.get('ScheduleState') === 'Accepted';
                })).get('_ValidFrom')), new Date(Rally.util.Array.last(Ext.Array.filter(records, function(record) {
                    return record.get('ScheduleState') === 'In-Progress';
                })).get('_ValidFrom')), 'day'));
            }
        });
    }
});
于 2013-09-24T16:30:39.063 回答