Rally - Lookback API: How to find user stories that entered In-Progress state?

Document ID : KB000129467
Last Modified Date : 14/03/2019
Show Technical Document Details
How can we find all instances of all user stories that entered the 'In-Progress' Schedule State?
Lookback API is the mechanism that should help with this. The key ingredient is that is has the _PreviousValues section that holds information of the changes made in each snapshot.

Here is such a query:

https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/<Your Workspace ObjectID>/artifact/snapshot/query.js?find={$and: [{"_TypeHierarchy":"HierarchicalRequirement"},{"ScheduleState":<Your In-Progress ScheduleState Value>}, {"_PreviousValues.ScheduleState": {"$ne":<Your In-Progress ScheduleState Value>}}]}&fields=["_SnapshotDate","_SnapshotNumber","FormattedID","Name","ScheduleState","_PreviousValues.ScheduleState"]&hydrate=["ScheduleState","_PreviousValues.ScheduleState"]&start=1&pagesize=2000 

- Replace: <Your Workspace ObjectID> with your proper value.
- Replace <Your In-Progress ScheduleState Value> with your proper value. You can use WSAPI query or other LBAPI queries to find it.

Essentially this query is asking for all snapshots of artifacts which are
- of type HierarchicalRequirement and
- that have ScheduleState match the value you shall replace for In-Progress, so snapshots in that state. and,
- that have _PreviousValues.ScheduleState that is not equal ($ne - see above) that state, so previously were in another state.