1

我注意到当我执行如下查询时:

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

我的结果集合回来了:

   {"_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

我对这方面很好奇:

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

其中显示了计划状态的 ObjectID (OID),而不是字符串值。有没有一种简单的方法可以取回 Schedule State 字符串而不是 OID?查找从调度状态 OID 到字符串的映射的最佳方法是什么?

4

1 回答 1

2

更新:Lookback API 最近已升级为包含水合物功能以解决此问题。这是它的工作原理...

水合物

默认情况下,在响应期间,此 API 不会尝试将下拉字段值从其本机 ObjectID 整数形式消歧为字符串。但是,您可以使用以下语法指定一些要水合的字段:

hydrate: ["State", "ScheduleState"]

这会将 State 和 ScheduleState 字段消歧回字符串。请注意,Analytics API 使用当前允许的值来消除歧义。快照中可能引用了较旧的值。这些 OID 不会被消除歧义。

于 2012-05-23T23:36:50.013 回答