问题
I am trying to use the lookback api to get stories that have the Ready flag set to true. I appear to be able to output the ready flag but not filter on it.
I do not appear to be able to filter or output the recycled flag.
Curious if these fields are not available to the lookback api as filters.
回答1:
Nick is right about the Recycled artifacts. I'm wondering though if you are quoting the Ready values and treating them like a String. This field is actually a Boolean and can be queried like this:
https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/12352608129/artifact/snapshot/query.js?find={"Ready":true}&fields=true
This doesn't work (since it's matching on the string "true" instead of the Boolean true).
https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/12352608129/artifact/snapshot/query.js?find={"Ready":"true"}&fields=true
It's also listed as #1 in the Tips and Tricks section of the documentation: https://rally1.rallydev.com/analytics/doc/Analytics2.0LookbackAPIUserManual.html#h.ce80nb6raonb
回答2:
I believe you're correct. In LBAPI documentation examples that illustrate the temporal data model show a gap when artifacts were moved to a recycle bin and later restored, or display no data after artifacts were moved to recycle bin and never restored.
Per this SO post, Lookback API doesn't provide anything along the lines of tracking entries in the Recycle Bin.
As far as Ready flag, a query like this will return the field value:
https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/12352608129/artifact/snapshot/query.js?find={"ObjectID":{$in:[16483705391,14167827399]}}&fields=["Name","Ready"]
e.g.
{
Name: "my story",
Ready: false
},
{
Name: "my story",
Ready: true
},
and this query will return results if value true
is treated as Boolean, not string, as SRMelody pointed out:
https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/12352608129/artifact/snapshot/query.js?find={"Ready":true}&fields=true
来源:https://stackoverflow.com/questions/21740230/rally-lookback-api-filter-on-ready-and-recycled