A user is working with AppSDK2 code where SnapshotStore is created to access historic data from Lookback API. See Lookback API manual here.
The find object of the store includes "__At": "current"
There is an example of a find object in Lookback API query in the manual that shows a usage of "__At": "current" .
"__At": "current" limits the query results to current snapshots of matching artifacts.
Whenever an AppSDK2 code does not return expected results please try to hit Lookback API endpoints directly in the browser to see if you get the same results. This removes the custom code as a factor.
It is also often useful to test your queries by hitting the endpoints directly before writing a single line of your code.
(Note: Custom coding and debugging of custom code is outside of Support's scope).
In this example a direct endpoint equivalent to the user's query in the code:
Ext.create('Rally.data.lookback.SnapshotStore', {
autoLoad: true,
hydrate: ['Project', 'Release', 'ScheduleState'],
find: {
'_TypeHierarchy': 'HierarchicalRequirement',
'__At': 'current',
'Children': null,
'_ProjectHierarchy': myProjectOID,
'Release': {"$in": arrayOfOIDsOfMyReleases}
},
fetch: ['FormattedID','Name','ScheduleState', 'PlanEstimate','Release'],
});
looks like this:
https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/<WORKSPACE_OID>/artifact/snapshot/query.js&fields=["FormattedID","Name","ScheduleState","PlanEstimate","Release"]&hydrate=["Release", "ScheduleState"]&find={"_TypeHierarchy":"HierarchicalRequirement","_ProjectHierarchy":<OBJECT_OID>,"Children":null,"Release":{"$in":[<OBJECT_OID>,<OBJECT_OID>,<OBJECT_OID>]},"__At": "current"}
The TotalResult count is 4.
If we make a change to one of the artifacts whose snapshots are included in the result, for example, if we change the ScheduleState of user story US24267shown in the screenshot above and reload the browser page where we hit this endpoint directly we will still see 4 snapshots, but the snapshot for story US24267 now shows ScheduleState of Completed.
In the next step we remove "__At": "current" from the find object. The modified endpoint looks like this:
https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/<WORKSPACE_OID>/artifact/snapshot/query.js&fields=["FormattedID","Name","ScheduleState","PlanEstimate","Release"]&hydrate=["Release", "ScheduleState"]&find={"_TypeHierarchy":"HierarchicalRequirement","_ProjectHierarchy":<OBJECT_OID>,"Children":null,"Release":{"$in":[<OBJECT_OID>,<OBJECT_OID>,<OBJECT_OID>]}}
This time the TotalResultCount is 23. It is expected that there has been many more snapshots of the stories that match the query criteria than the current snapshots allowed in by "__At": "current".
Next, we change ScheduleState of a story US1578 shown in the screenshot above. We want to see if the TotalResultCount changes to 24. We reload the browser page where we hit this endpoint directly and see that the number of snapshots has been incremented to 24, and includes a new snapshot where story US1578 was moved from Completed to Accepted.