从项目Azure Devops REST API获取所有工作项
我正在使用Azure devops API通过AWS Lambda node.js创建一个通知机器人.此时,我需要检查每个任务工作项是否都附加到父用户故事.
I'm using Azure devops API to create a notification bot with AWS Lambda node.js. At this moment i need to check if each task work item is attached to a parent user story.
第一步是将所有任务工作项按给定"显示.项目,对于这一步,我正在阅读azure devops api文档并发现了以下内容:
The first step will be to get all the task work items on "given" project, for this step i was reading azure devops api documentation and found this: Work Items - List
API正在询问我想要获取的工作项的ID,但是如果我需要给定"的所有工作项怎么办?项目?
The API is asking for the id of the workitem that i want to get, but what if i need all the workitems from "given" project?
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems?ids={ids}&api-version=5.1
还是有其他方法可以从给定项目中获取所有工作项ID?
Or is there any other way to get all the workitem ids from a given project?
You can use Work Items - Get Work Items Batch API that doesn't require ids but the maximum work items in the results are 200.
但是,如果需要检查任务",为什么需要所有项目中的工作项?您只能使用
But, if you need to check Tasks, why you need get all the work items in the project? you can get only the Tasks, with Wiql - Query By Wiql API:
POST https://dev.azure.com/{organization}/{project}/{team}/_apis/wit/wiql?api-version=5.1
在正文中进行查询:
{
"query": "Select [System.Id], [System.Title], [System.State] From WorkItems Where [System.WorkItemType] = 'Task'"
}