任何 Azure DevOps API 均可获取任何工作项的 Microsoft.VSTS.Scheduling.OriginalEstimate 值

问题描述 投票:0回答:2

任何 Azure DevOps API,用于获取冲刺中任何/所有工作项的 Microsoft.VSTS.Scheduling.OriginalEstimate 的值。

azure-devops azure-devops-rest-api azure-boards
2个回答
1
投票

任何 Azure DevOps API 均可获取以下价值 Microsoft.VSTS.Scheduling.OriginalEstimate 中的任何/所有工作项 冲刺。

由于您尝试使用

Microsoft.VSTS.Scheduling.OriginalEstimate
获取特定春季特定项目的工作项目,因此您必须结合使用
WorkItems-Get/Get batch/List
Query by WIQL

以下 API 可以返回具有给定 Id 的

Microsoft.VSTS.Scheduling.OriginalEstimate

1.我们可以使用获取工作项来获取某个特定工作项的详细信息,响应将包含有关

OriginalEstimate
的信息。

GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=6.1-preview.3

2.我们可以使用批量获取工作项来根据id获取工作项列表,并且我们可以根据请求正文自定义响应:

POST https://dev.azure.com/{organization}/{project}/_apis/wit/workitemsbatch?api-version=6.1-preview.1

请求正文:

{
  "ids": [
    124,
    125
  ],
  "fields": [
    "System.Id",
    "System.Title",
    "System.WorkItemType",
    "Microsoft.VSTS.Scheduling.OriginalEstimate"
  ]
}

3.工作项 - 列表可用于列出具有指定字段的所有或特定工作项:

GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems?ids={ids}&fields=System.Id,System.Title,System.WorkItemType,Microsoft.VSTS.Scheduling.OriginalEstimate&api-version=6.1-preview.3

Get Work Items Batch
Work Items-List
都可以返回值为
Microsoft.VSTS.Scheduling.OriginalEstimate
的工作项。不同之处在于
Get Work Items Batch
使用
Post
并在请求正文中定义 ID,而
Work Items-List
使用
Get
并将 ID 定义为 URI 参数。

这里是根据 WIQL 获取 workItem id 的 API:

通过 Wiql 查询可以返回特定 sprint 的工作项 Id:

POST https://dev.azure.com/{organization}/{project}/_apis/wit/wiql?api-version=6.1-preview.2

请求正文:

{
  "query": "Select [System.Id] From WorkItems Where [System.TeamProject] = @project AND [System.IterationPath]= 'YourIterationPath'"
}

如果你的

IterationPath
有这样的结构,上面的
YourIterationPath
应该根据你的需要替换为
CommonTests
CommonTests\\Iteration 1


0
投票

要访问 API 及其关系,您必须使用以下 URL:

https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=5.1&$expand=relations

URL 中的参数

$expand=relations
是检索关系所必需的。

© www.soinside.com 2019 - 2024. All rights reserved.