Custom Cycle Time

牧云@^-^@ 提交于 2019-12-13 01:17:32

问题


How do I determine how long something spent in a state? Here is a query I have for pulling specifics on a user story, but I'm trying to understand how to get the duration something spent in In Progress before going to completed. To be more specific, customizing Cycle Time

https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/xxxx/artifact/snapshot/query.js?find={"FormattedID":"US41","_PreviousValues.ScheduleState":"In-Progress"}&fields=["ScheduleState","_ValidFrom","_ValidTo","_PreviousValues"]&hydrate=["ScheduleState","_ValidFrom","_ValidTo","_PreviousValues"]&sort={_ValidFrom: -1}&pagesize=1

I don't see where the ValidFrom and ValidTo provides that information.


回答1:


This solution seems to be working for me. Hope it helps!

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'));
            }
        });
    }
});


来源:https://stackoverflow.com/questions/18971688/custom-cycle-time

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!