2013-05-09 34 views
0

是否有一種方法可以使用LookbackAPI查詢從某個日期(例如一個星期前)到今天更改PlanEstimate的所有故事(HierarchicalRequirement)?使用LookbackAPI查找範圍更改

或者是最好的方法來查找過去給定日期的所有故事並返回PlanEstimate和UnformatedID字段,然後將它們與當前的PlanEstimate進行比較,以確定每個故事截至今天爲止?

回答

1

每個LBAPI快照將有一個_PreviousValues集合。對於每個LBAPI快照,如果一個字段已經從前一個快照中更改,那麼_PreviousValues集合將被水合爲該值。換句話說,如果PlanEstimate在快照之間沒有更改,那麼該快照的_PreviousValues集合中將不會有PlanEstimate條目。因此,對於PlanEstimate,下面的查詢:

find: { 
    "_TypeHierarchy" : "HierarchicalRequirement", 
    "_PreviousValues.PlanEstimate" : {$exists: true}, 
    "_ValidFrom": { 
     $gte: "2013-01-01T00:00:00.000Z", 
     $lt: "2013-05-01T00:00:00.000Z" 
    } 
} 

應爲您提供對應於PlanEstimate從2013年5月1日至2013年5月10日變更任何HierarchicalRequirement快照。