user2099986
user2099986

Reputation: 137

How to use Lookbackapi to fetch all the _PreviousValues of a field

I am trying to get all the "_PreviousValues" of a field.

For example, the state of a defect have changed from "Open" => "Fixed" => "Closed".

I would like to get all history of the state, but not just the previous value.

Thanks!

Upvotes: 1

Views: 94

Answers (1)

nickm
nickm

Reputation: 5966

LookbackAPI returns historic versions (snapshots) of objects. To get a history of state transitions you need to get all snapshots where transition happened, which can be achieved by using "_PreviousValues.State":{"$exists":true} condition.

https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/111/artifact/snapshot/query.js?find={"Project":222,"_TypeHierarchy":"Defect","_PreviousValues.State":{"$exists":true}}&fields=["ObjectID","_ValidFrom","_ValidTo","FormattedID","State","_PreviousValues.State"]&hydrate=["State","_PreviousValues.State"]&compress=true

Upvotes: 1

Related Questions