【问题标题】:Create Sprint Burndown chart cross-org from Azure DevOps in Power BI从 Power BI 中的 Azure DevOps 创建跨组织的 Sprint Burndown 图表
【发布时间】:2020-09-08 15:22:47
【问题描述】:

我有以下查询来在 Azure DevOps 中构建 Sprint Burndown 跨组织。它工作正常且流畅。

OData.Feed ("https://analytics.dev.azure.com/" & organization & "/" & projectName & "/_odata/v3.0-preview/WorkItemSnapshot?"
        &"$apply=filter(WorkItemType eq 'User Story'  and StateCategory ne 'Completed' and DateValue ge Iteration/StartDate and DateValue le Iteration/EndDate and Iteration/StartDate ge 2020-01-01Z)"
        &"/groupby( "
            &"(DateValue,State,WorkItemType,Area/AreaPath,Iteration/IterationPath,Iteration/StartDate,Iteration/EndDate), "
            &"aggregate($count as Count, StoryPoints with sum as TotalStoryPoints) "
        &") ",
    [#"Authorization" = "Basic " & apiKey]
    , [Implementation="2.0",OmitValues = ODataOmitValues.Nulls,ODataVersion = 4])

但是,我也想查询每个项目下的团队,但与迭代和区域相比,它不像在 groupby 部分中添加 Teams/TeamName 那样简单。

以下是我失败的尝试:

OData.Feed ("https://analytics.dev.azure.com/" & organization & "/" & projectName & "/_odata/v3.0-preview/WorkItemSnapshot?"
        &"$apply=filter(WorkItemType eq 'User Story'  and StateCategory ne 'Completed' and DateValue ge Iteration/StartDate and DateValue le Iteration/EndDate and Iteration/StartDate ge 2020-01-01Z)"
        &"/groupby( "
            &"(DateValue,State,WorkItemType,Teams/TeamName,Area/AreaPath,Iteration/IterationPath,Iteration/StartDate,Iteration/EndDate), "
            &"aggregate($count as Count, StoryPoints with sum as TotalStoryPoints) "
        &") ",
    [#"Authorization" = "Basic " & apiKey]
    , [Implementation="2.0",OmitValues = ODataOmitValues.Nulls,ODataVersion = 4])

【问题讨论】:

  • 我尝试过使用$expand,但加载速度很慢。

标签: azure-devops powerbi odata


【解决方案1】:

我发现更有效的方法是使用另一个 OData 端点 WorkItemBoardSnapshot,我可以在其中执行服务器端 groupby,这比在 Power BI 中执行要高效得多。

这里有一些参考:

OData.Feed ("https://analytics.dev.azure.com/" & organization & "/" & projectName &"/_odata/v3.0-preview/WorkItemBoardSnapshot?"
        &"$apply=filter(WorkItemType eq 'User Story'  and StateCategory ne 'Completed' and DateValue ge Iteration/StartDate and DateValue le Iteration/EndDate and Iteration/StartDate ge 2020-01-01Z)"
        &"/groupby("
            &"(DateValue,WorkItemType,Team/TeamName,Iteration/IterationPath,Iteration/StartDate,Iteration/EndDate),"
            &"aggregate($count as Count, StoryPoints with sum as TotalStoryPoints)"
        &")",
    [#"Authorization" = "Basic " & apiKey]
    , [Implementation="2.0",OmitValues = ODataOmitValues.Nulls,ODataVersion = 4])

差异将WorkItemSnapshot 更改为WorkItemBoardSnapshot 并注意板快照使用Team 而不是Teams

【讨论】:

  • 嗨 rick,感谢您的分享,您可以接受您的回答。在这种情况下,其他人可以直接找到有用的解决方案。
  • 嗨 Dharman,我尝试使用相同的 :**WorkItemBoardSnapshot** 表,我的目标是过滤并根据 Srint End of Date 显示所有工作项的趋势,但是,每次我尝试时:OData.Feed("https://analytics.dev.azure.com/{organization}/{proyect}/_odata/v3.0-preview/WorkItemSnapshot?" &"$apply=filter(DateValue eq Iteration/StartDate)" , null , [Implementation="2.0",OmitValues = ODataOmitValues.Nulls,ODataVersion = 4]) it总是抛出一个“空表”结果。你知道我错过了什么吗?
猜你喜欢
  • 1970-01-01
  • 2022-10-19
  • 2021-09-27
  • 1970-01-01
  • 2021-02-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-07-01
相关资源
最近更新 更多