从项目Azure Devops REST API获取所有工作项 [英] Get all work items from a project azure devops REST API

查看:57
本文介绍了从项目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'"
}

这篇关于从项目Azure Devops REST API获取所有工作项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆