从此 Azure Devops API 返回的最大工作项数是多少?

What is the max number of work items returned from this Azure Devops API?

我正在使用此处列出的 API:Get Work Items between Builds 制作一个内部产品,让我们可以快速为我们产品的每个版本构建发行说明。但我似乎经常得到 50 的总 return 值。我们现在注意到一些结果被遗漏了。 50是这个APIreturn的极限吗?我在页面上没有看到任何关于此的指示。

您可以在休息时使用 $top 过滤器检索更多工作项 api Get Work Items between Builds

对于以下 powershell 脚本中的示例:

# special character `$` in `$top` needs to be escaped.
$url = "https://dev.azure.com/ORG/PROJ/_apis/build/workitems?fromBuildId=8913&toBuildId=8917&`$top=200&api-version=6.1-preview.2"

$PAT="....."
$base64AuthInfo= [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($PAT)"))

$result = Invoke-RestMethod -Uri $url -Headers @{authorization = "Basic $base64AuthInfo"} -Method get

$result.count

注意:您需要通过添加反引号“'”来转义 $top 过滤器中的特殊字符 $

下面是我的测试结果。我可以获得所有相关的工作项目。