任何Azure DevOps API均可获得sprint中任何/所有工作项的Microsoft.VSTS.Scheduling.OriginalEstimate值。
答案 0 :(得分:1)
任何Azure DevOps API均可获取 Microsoft.VSTS.Scheduling.OriginalEstimate的任何/所有工作项 冲刺。
由于您要在特定的春季尝试使用Microsoft.VSTS.Scheduling.OriginalEstimate
获得特定项目的workItems,因此必须结合使用WorkItems-Get/Get batch/List
和Query by WIQL
。
以下是可以返回给定ID的Microsoft.VSTS.Scheduling.OriginalEstimate
的API:
1。我们可以使用Get Work Item来获取有关一个特定工作项的详细信息,响应中将包含有关OriginalEstimate
的信息。
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=6.1-preview.3
2。我们可以使用Get Work Items Batch根据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。Work Items - List可用于列出具有指定字段的所有或特定工作项:
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参数。
此处的API可基于WIQL获取工作项ID:
Query By Wiql可以返回特定冲刺的工作项目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
。