Question

I'm noticing that when I do a query such as the following:

   https://rally1.rallydev.com/analytics/1.27/41529001/artifact/snapshot/query.js?find={ _Type: "HierarchicalRequirement",ScheduleState:"In-Progress",__At:"current"},fields=true

My results collection is coming back with this:

   {"_rallyAPIMajor":"1","_rallyAPIMinor":"27","Errors":[],"Warnings":[],"ThreadStats":{"elapsedCpu":"10.0","waitTime":"0","blockedTime":"0","waitCount":"0","blockedCount":"0"},"Timings":{"preProcess":10.0,"findEtlDate":0.0,"allowedValuesDisambiguation":0.0,"mongoQuery":0.0,"authorization":0.0,"postProcess":0.0,"other":0.0,"TOTAL":10.0},"GeneratedQuery":{"find":{"ScheduleState":{"$in":[41529076]},"$and":[{"_ValidFrom":{"$lte":"2012-05-23T18:25:41.363Z"},"_ValidTo":{"$gt":"2012-05-23T18:25:41.363Z"}}],"_ValidFrom":{"$lte":"2012-05-23T18:25:41.363Z"}},"workspace":41529001},"TotalResultCount":2205,"StartIndex":0,"PageSize":100,"ETLDate":"2012-05-23T18:25:41.363Z","Results": ... RESULTS HERE

I'm curious about this aspect:

  "ScheduleState":{"$in":[41529076]}

Which shows the ObjectID (OID) of the Schedule State rather than a String value. Is there an easy way to get back Schedule State strings instead of OIDs? What's the best way to lookup the mapping from Schedule State OIDs to Strings?

Was it helpful?

Solution

Update: The Lookback API has recently been upgraded to include hydrate functionality to address this issue. Here's how it works...

Hydrate

By default, during the response, this API does not attempt to disambiguate drop-down field values from their native ObjectID integer form into strings. However, you can specify some fields to be hydrated using this syntax:

hydrate: ["State", "ScheduleState"]

This will disambiguate the State and ScheduleState fields back into strings. Note, the Analytics API is using the current allowed values to do this disambiguation. It's possible that there are older values referenced in the snapshots. Those OIDs will not be disambiguated.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top