嗨,我想在特定日期从多程序项目中获得接受的故事点。在这种情况下,我想回到前一年。为什么我没有收到上一年接受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);
}