自定义周期时间 [英] Custom Cycle Time

查看: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":"进行中"}&fields=["ScheduleState","_ValidFrom","_ValidTo","_PreviousValues"]&hydride=["ScheduleState","_ValidFrom","_ValidTo","_PreviousValues"]&sort={_ValidFrom: -1}&pagesize=1

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

我没有看到 ValidFrom 和 ValidTo 在哪里提供这些信息.

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

推荐答案

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

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

这篇关于自定义周期时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆