Hi,
Given a feature, I'm trying to retrieve the list of its stories at yesterday date but the list provided by Rally seems not to be accurate...
The feature and its stories have not changed at all since weeks, so the list of stories is stable: yesterday list is the same as the current list. According to the Rally user interface, I can see that I have 5 stories in my feature:
I run the following query, from a Javascript app, to retrieve the list of stories of the feature thanks to the WSAPI (data for current date). It works well:
var t0 = performance.now();
console.log('----------------------------');
console.log('LOAD FEATURE AT CURRENT DATE');
console.log('----------------------------');
var feature = Ext.create('Rally.data.wsapi.Store', {
model: 'PortfolioItem/Feature',
context: {
workspace: '/workspace/2160184711',
project: '/project/26964342459'
},
fetch: ['FormattedID', 'UserStories'],
filters: [
{
property: 'FormattedID',
operator: '=',
value: [featureFormattedID]
}
]
});
feature.load({
callback: function(result, operation) {
if (operation.wasSuccessful()) {
_.each(result, function (f) {
var fID = f.get('FormattedID');
var stories = f.get('UserStories');
console.log('Feature ' + f.get('FormattedID') + ' has ' + stories.Count + ' stories');
if (stories.Count > 0) {
stories.store = f.getCollection('UserStories', {
context: {
workspace: '/workspace/2160184711',
project: '/project/26964342459'
},
fetch: ['FormattedID']
});
stories.store.load().then(
(stories) => {
_.each(stories, function (story) {
var sId = story.get('FormattedID');
console.log (' - ' + sId);
});
var t1 = performance.now();
console.log('Execution took ' + parseFloat((t1 - t0)/1000).toFixed(2) + ' seconds');
},
(rejectReason) => { console.log(rejectReason); }
);
}
});
}
else {
console.log('Feature loading exception!');
}
}
});
In less than 2 seconds I can get my 5 stories. Here is the console output:
Now, I use the LookbackAPI to get the list of stories a few days in the past: I should get 5 stories but I only get 4:
var t0 = performance.now();
console.log('------------------------------');
console.log('LOAD FEATURE AT '+isoDate+' (1)');
console.log('------------------------------');
var feature = Ext.create('Rally.data.lookback.SnapshotStore', {
context: {
workspace: '/workspace/2160184711',
project: '/project/26964342459'
},
fetch: ['FormattedID', 'UserStories'],
filters: [{
property: '_TypeHierarchy',
operator: '=',
value: 'PortfolioItem/Feature'
},
{
property: '__At',
value: isoDate
},
{
property: 'FormattedID',
operator: 'in',
value: ['F12986']
}
]
});
feature.load({
callback: function(result, operation) {
if (operation.wasSuccessful()) {
_.each(result, function (f) {
var fID = f.get('FormattedID');
var stories = f.get('UserStories');
console.log('Feature ' + f.get('FormattedID') + ' has ' + stories.length + ' stories');
if (stories.length > 0) {
var listOfStories = [];
_.each(stories, function (s) {
listOfStories.push(s);
});
console.log('List of stories to be retrieved: ', listOfStories);
var stories = Ext.create('Rally.data.lookback.SnapshotStore', {
context: {
workspace: '/workspace/2160184711',
project: '/project/26964342459'
},
fetch: ['FormattedID'],
filters: [
{
property: '_TypeHierarchy',
operator: '=',
value: 'HierarchicalRequirement'
},
{
property: '__At',
value: isoDate
},
{
property: 'ObjectID',
operator: 'in',
value: listOfStories
}
]
});
stories.load().then(
(stories) => {
_.each(stories, function (story) {
var sId = story.get('FormattedID');
console.log (' - ' + sId);
});
var t1 = performance.now();
console.log('Execution took ' + parseFloat((t1 - t0)/1000).toFixed(2) + ' seconds');
},
(rejectReason) => { console.log(rejectReason); }
);
}
});
}
else {
console.log('Feature loading exception!');
}
}
});
In about 5s. I get my incomplete list. Here is the console ouput:
As shown in the console, the feature "UserStories" list is incomplete: only 4 stories references are stored there. So, when I try to retrieve the stories listed in the feature, I only get 4.
Let's try another approach: instead of searching for stories listed in the feature.UserStories list, I'll search for all the stories of the workspace/project that have the Feature attribute that match my feature identifier:
var t0 = performance.now();
console.log('------------------------------');
console.log('LOAD FEATURE AT '+isoDate+' (2)');
console.log('------------------------------');
var feature = Ext.create('Rally.data.lookback.SnapshotStore', {
context: {
workspace: '/workspace/2160184711',
project: '/project/26964342459'
},
fetch: ['ObjectID', 'FormattedID', 'UserStories'],
filters: [{
property: '_TypeHierarchy',
operator: '=',
value: 'PortfolioItem/Feature'
},
{
property: '__At',
value: isoDate
},
{
property: 'FormattedID',
operator: 'in',
value: ['F12986']
}
]
});
feature.load({
callback: function(result, operation) {
if (operation.wasSuccessful()) {
_.each(result, function (f) {
var fOID = f.get('ObjectID');
var fID = f.get('FormattedID');
var stories = f.get('UserStories');
console.log('Feature ' + f.get('FormattedID') + ' has ' + stories.length + ' stories');
if (stories.length > 0) {
var stories = Ext.create('Rally.data.lookback.SnapshotStore', {
context: {
workspace: '/workspace/2160184711',
project: '/project/26964342459'
},
fetch: ['FormattedID'],
filters: [
{
property: '_TypeHierarchy',
operator: '=',
value: 'HierarchicalRequirement'
},
{
property: '__At',
value: isoDate
},
{
property: 'Feature',
operator: '=',
value: fOID
}
]
});
stories.load().then(
(stories) => {
_.each(stories, function (story) {
var sId = story.get('FormattedID');
console.log (' - ' + sId);
});
var t1 = performance.now();
console.log('Execution took ' + parseFloat((t1 - t0)/1000).toFixed(2) + ' seconds');
},
(rejectReason) => { console.log(rejectReason); }
);
}
});
}
else {
console.log('Feature loading exception!');
}
}
});
That much more longer, about 15s., but I get my 5 stories. Here is the console output: