Search code examples
rally

Get Rally User Story snapshot for a given revision


Using the Rally Rest Api I'm trying to get a User Story at a given point in time, like I request the User Story now. I know how to get the Hierarchical Requirement

https://rally1.rallydev.com/slm/webservice/v2.0/HierarchicalRequirement/‹ObjectID›/

I know how to get the revisions

https://rally1.rallydev.com/slm/webservice/v2.0/RevisionHistory/‹ObjectID›

Now with this, I have all the history of revisions (Created [rev 0], Name changed [rev 1], etc [rev ..], BLOCKED [rev N -1], UNBLOCKED [rev N])

Let's say I want to see the FULL Hierarchical Requirement at rev 2 (with the new name) or the FULL Hierarchical Requirement at rev N-1, when it was blocked, but I want to get it like if I was doing https://rally1.rallydev.com/slm/webservice/v2.0/HierarchicalRequirement/‹ObjectID›/

Is there a way to get these snapshots?


Solution

  • If you want to see what a particular user story looked like at a specific point in time, you would use the lookback api.

    Within the find parameter you will specify at least 2 options:

    • ObjectID: The ID of the artifact you're interested in
    • __At: This is an ETL Date Timestamp specifying the point in time that the snapshot will represent. For this, you can use the CreationDate field that is found on each of the Revision objects from your previous query.

    An example request looks like this:

    https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/123456789/artifact/snapshot/query.js?find={ObjectID:123456789,__At:"2020-12-10T00:00:00Z"}&fields=true
    

    Now what I can't be certain of without testing is whether or not using the Revision CreationDate in the Lookback query will return the state of the artifact just before the change or just after. This is because the creation of Revisions in the WSAPI and the creation of snapshots in the LBAPI aren't coupled that tightly (from what I understand). You'll have to do some testing to verify and maybe adjust the timestamp accordingly.