如何为VSTS构建获取50个以上的相关工作项? [英] How do I get more than 50 associated work items for a VSTS build?

查看:41
本文介绍了如何为VSTS构建获取50个以上的相关工作项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用VSTS Build(2.0)API来检索关联的工作项和给定版本的更改.此版本有100个与之相关的工作项.当我使用get build details/work items REST方法时,它将仅检索50个项目.我尝试了以下方法: https://my-account.visualstudio.com/DefaultCollection/MyProject/_apis/build/builds/7/workitems?api-version=2.0 //未指定工作项的最大数量->返回50 https://my-account.visualstudio.com/DefaultCollection/MyProject/_apis/build/builds/7/workitems?api-version=2.0& $ top = 100//指定最多100个项目->返回50 https://my-account.visualstudio.com/DefaultCollection/MyProject/_apis/build/builds/7/workitems?api-version=2.0& $ top = 0////指定0的顶部,希望表示全部->它不返回任何值 https://my-account.visualstudio.com/DefaultCollection/MyProject/_apis/build/builds/7/workitems?api-version=2.0& $ top = -1//指定-1的顶部,希望表示全部->它不返回任何值 https://my-account.visualstudio.com/DefaultCollection/MyProject/_apis/build/builds/7/workitems?api-version=2.0& $ top = 50& $skip = 50//希望获得接下来的50个项目(51..100)->它返回相同的前50个

I’m trying to use the VSTS Build (2.0) API to retrieve the associated work items and changes for a given build. This build has 100 work items associated with it. When I use the get build details/work items REST method, it will only retrieve 50 items. I’ve tried the following: https://my-account.visualstudio.com/DefaultCollection/MyProject/_apis/build/builds/7/workitems?api-version=2.0 // Without specifying a maximum number of work items -> it returns 50 https://my-account.visualstudio.com/DefaultCollection/MyProject/_apis/build/builds/7/workitems?api-version=2.0&$top=100 // specifying a maximum of 100 items -> it returns 50 https://my-account.visualstudio.com/DefaultCollection/MyProject/_apis/build/builds/7/workitems?api-version=2.0&$top=0 // specifying a top of 0, hoping that means all -> it returns none https://my-account.visualstudio.com/DefaultCollection/MyProject/_apis/build/builds/7/workitems?api-version=2.0&$top=-1 // specifying a top of -1, hoping that means all -> it returns none https://my-account.visualstudio.com/DefaultCollection/MyProject/_apis/build/builds/7/workitems?api-version=2.0&$top=50&$skip=50 // hoping to get the next 50 items (51..100) -> it returns the same first 50

您知道如何获取相关工作项的完整列表吗?以及与此相关的更改?

Any idea how I can get the complete list of associated work items? And associated changes, for that matter?

推荐答案

您无法通过单个Rest API(

You can't do this through a single Rest API(https://www.visualstudio.com/en-us/docs/integrate/api/build/builds#work-items) for now.

我也有类似的经历,最后发现了这个问题:

I had a similar experience and finally found this issue: TFS 2017 Update1: Associated Work Items for a build has a limit of 50 work items. However the issue still Under Consideration without any udpate.

最终,作为一种解决方法,我获得了单个构建的所有相关变更集,并检索了每个变更集的所有相关工作项.

Eventually, as a workaround, I get all related changesets for a single build and retrieve all related work items for each changesets.

有效执行,但效率不高.

Perform effectively but not efficiently.

这篇关于如何为VSTS构建获取50个以上的相关工作项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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