1

こんにちは、特定の日付にマルチプログラム アイテムから受け入れられたストーリー ポイントを取得したいと考えています。この場合、前の年に戻りたいと思います。前年から SP を受け入れたスナップショット データが取得されないのはなぜですか?

これは現在、昨年から受け入れられたSPを返してくれない私のコードです:

_loadMP: function() {
     var mpEpics = Ext.create('Rally.data.wsapi.artifact.Store', {
            models: ['PortfolioItem/multiprogramepic'],
            fetch: ['FormattedID', 'Name', 'Owner', 'LeafStoryPlanEstimateTotal', 'AcceptedLeafStoryPlanEstimateTotal', 'PercentDoneByStoryPlanEstimate', 'PlannedStartDate', 'PlannedEndDate',  'Children'],
            autoLoad: true,
            limit: Infinity,
            pageSize: 9999,         
        });

        mpEpics.load().then({
            success: this._MPLoaded,
            scope: this
        });
    },

_MPLoaded: function(items) {
    var me = this;
    _.each(items, function(item) {
    me._calculatePreviousYear(item.get("ObjectID"), item.get("PlannedStartDate"), item.get("PlannedEndDate"));
},

_calculatePreviousYear: function(objID, startDate, endDate){
    var currentYear = Rally.util.DateTime.format(startDate, 'Y');
    var prevYear = new Date();
    prevYear.setFullYear(currentYear, 0, 1);
    prevYear.setHours(0, 0, 1); 
       var projectStore = Ext.create('Rally.data.lookback.SnapshotStore', {
            find: {
                _TypeHierarchy: {
                    '$in': ['HierarchicalRequirement']
                },
                _ItemHierarchy: objID,
                _ValidFrom: {
                    "$gte": startDate,
                    "$lte": prevYear
                },
            },
            fetch: ['FormattedID'],
            hydrate: ['Project'],
            sort: {
                "_ValidFrom": 1
            },
            limit: Infinity,
            context: this.getContext().getDataContext(),
            removeUnauthorizedSnapshots: true
        });

        console.log(objID, projectStore);
    }
4

1 に答える 1

0

ルックバック API の _ValidFrom フィールドと _ValidTo フィールドは文字列であるため、startDate と prevYear の値を Rally.util.DateTime.toIsoString() でラップする必要があるだけかもしれません。コードが単なる代表的なものなのか、実際に動作するコードなのかはわかりませんが、進行状況に影響を与える可能性のある _MPLoaded に } がないようです。

于 2016-03-07T15:07:25.047 に答える