Agile Central - LookBack API: How many times was a user story blocked?
search cancel

Agile Central - LookBack API: How many times was a user story blocked?


Article ID: 112264


Updated On:


Rally On-Premise Rally SaaS


How can we use the API to how many times and all instances where a user story was Blocked?


Component: ACSAAS


Since this request is for historical data of the artifact we will have to use the Lookback API.
Here is an example Lookback API query you can use:<WORKSPACE_OID>/artifact/snapshot/query.js?find={$and: [{"FormattedID":<FORMATTED_ID>}, {"Blocked": true}, {"_PreviousValues.Blocked": false}]}&fields=["_SnapshotDate","_SnapshotNumber","Blocked","Blocker","BlockedReason"]

This query is requesting all snapshots of the artifact where the Blocked state was 'true' along with a _PreviousValue of the Blocked state be 'false'. This combination suggests this was a snapshot where the artifact was set to be blocked. 

Here is a screenshot of the JSON output:

In above JSON you see this artifact was blocked 3 times in snapshotNumbers 1, 5 and 10. You can see the timestamp of each block and the user (objectID) who blocked it.

The BlockedReason field might not necessarily conform to the same snapshots of the Blocked state. Reason may or may not have been given, and unnecessarily in the same snapshots. Therefore, if you needed to make certain of the BlockedReason that correspond to Block, you may need to run subsequent queries to find the change in the BlockedReason field subsequent to each of these snapshots.

Additional Information

More on Lookback API: