Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure devops 为什么Azure Devops IterationId是工作项历史的Int?_Azure Devops_Azure Devops Rest Api - Fatal编程技术网

Azure devops 为什么Azure Devops IterationId是工作项历史的Int?

Azure devops 为什么Azure Devops IterationId是工作项历史的Int?,azure-devops,azure-devops-rest-api,Azure Devops,Azure Devops Rest Api,我正在使用Azure DevOps API查询工作项,以了解迭代如何随时间变化的历史 因此,我从一个典型的工作项查询开始,如下所示: https://[ourserver]/[collection]/[project]/_apis/wit/workItems/[wi-id]/updates 在返回的JSON中,我可以看到迭代更改。到目前为止还不错 "System.IterationId": { "oldValue": 11068, "

我正在使用Azure DevOps API查询工作项,以了解迭代如何随时间变化的历史

因此,我从一个典型的工作项查询开始,如下所示:

https://[ourserver]/[collection]/[project]/_apis/wit/workItems/[wi-id]/updates
在返回的JSON中,我可以看到迭代更改。到目前为止还不错

"System.IterationId": {
   "oldValue": 11068,
   "newValue": 11529
},
我的问题是当我试图检索与这些ID关联的完整迭代记录时。RESTAPI似乎对ID使用GUID,而不是INT。下面是一个例子:

https://[ourserver]/[collection]/[project]/[team]/apis/work/teamsettings/iterations

{
   "id": "3c117833-d770-47f1-a483-65461c440721",
   "name": "Sprint 3",
   "path": "aa\\bb\\cc\\Sprint 3",
   "attributes": {
      "startDate": "2020-02-05T00:00:00Z",
      "finishDate": "2020-02-18T00:00:00Z",
      "timeFrame": "past"
}

那么,工作项历史记录中的
系统.IterationId
与REST API中用于迭代id的GUID之间的神奇链接在哪里呢?

您可以通过REST API获得迭代id:

GET https://dev.azure.com/{organization}/{project}/_apis/wit/classificationnodes?ids={ids}&api-version=5.1
您还可以使用URL参数
$depth=2
获取子项


在结果中,您将获得
id
,这是您在工作项更新中获得的
System.IterationId
值,以及
identifier
这是您通过
teamsettings/iterations
api获得的GUID。

thx@Shayki,99%在那里!在我的示例中,我能够找到新的id 11529,但以前的id 11068没有返回任何内容。似乎AzDo不记得删除的项目。我找不到任何AsOf参数来添加URL,你遇到过这个问题吗?@sisdog-Hmm我以前没有尝试过,我认为你没有AsOf到这个API:(