从 Azure DevOps 分析中提取冲刺计划时间的快照

Extract from Azure DevOps analytics a snapshot of sprint planning hours

我需要获取 Azure DevOps 分析的快照,该分析可以为我提供在冲刺计划日期预测的小时数。如果可能,按父 ID 分组。

我还需要第二个视图,按 activity 分组,但从第一个开始我相信我可以达到第二个。

以下是尝试咨询,但效果不是很好。它 returns 一条错误消息,我不明白为什么。

https://analytics.dev.azure.com/{org}/{project}/_odata/v3.0-preview//WorkItemSnapshot?$filter=(DateValue ge Iteration/StartDate and DateValue le Iteration/StartDate and WorkItemType eq 'Task')/groupby((Activity), aggregate($count as Count, RemainingWork with sum as WorkTotal))

错误:

{"error":{"code":"0","message":"VS403483: The query specified in the URI is not valid: ')' or ',' expected at position 136 in '(DateValue ge Iteration/StartDate and DateValue le Iteration/StartDate and WorkItemType eq 'Task')/groupby((Activity), aggregate($count as Count, RemainingWork with sum as RemainingWorkTotal))'..","innererror":{"message":"')' or ',' expected at position 136 in '(DateValue ge Iteration/StartDate and DateValue le Iteration/StartDate and WorkItemType eq 'Task')/groupby((Activity), aggregate($count as Count, RemainingWork with sum as RemainingWorkTotal))'.","type":"Microsoft.OData.ODataException","stacktrace":""}}}

补充我的需要,我需要获取下图中以黄色突出显示的值:

https://ibb.co/WfHdtBq

请尝试使用“$apply=filter”而不是“$filter=”。 $apply 触发聚合行为。它采用一系列集合转换,用正斜杠分隔以表示它们是连续应用的,即每个转换的结果是下一个转换的输入。请参考this document.

另外,我觉得你可以用DateValue le Iteration/EndDate代替DateValue le Iteration/StartDateDateValue ge Iteration/StartDate 表示在迭代开始时开始趋势,DateValue le Iteration/EndDate 表示在迭代结束时结束趋势。可以参考sample reports-OData query.

这是我的查询,它对我有效:

https://analytics.dev.azure.com/{org}/{project}/_odata/v3.0-preview/WorkItemSnapshot?
$apply=filter(
    DateValue ge Iteration/StartDate 
    and DateValue le Iteration/EndDate 
    and WorkItemType eq 'Task'
    )
    /groupby(
        (Activity), 
    aggregate($count as Count, RemainingWork with sum as WorkTotal)
    )

结果: