【问题标题】:how to get all the Task in a Workitem in Json form by postman for TFS API如何通过邮递员为 TFS API 以 Json 形式获取工作项中的所有任务
【发布时间】:2018-02-19 13:20:26
【问题描述】:

我目前正在使用 TFS API 谁的链接是 https://www.visualstudio.com/en-us/docs/integrate/api/wit/work-items#byids

目前在我的项目中,我想获得以下工作项 61092 的所有任务 http://apactfs.cbre.com:8080/tfs/CBRE.APAC.Applications/MRI_SCRUM_GIT/_workitems?_a=edit&id=61092

为此,我在邮递员 GET 中使用此链接

http://apactfs.cbre.com:8080/tfs/cbre.apac.applications/_apis/wit/workitems/61092?$expand=all&api-version=1.0

我得到了所有与之相关的任务,但没有得到所有的字段,例如任务中的小时数,我想要的任务的用户。

在 Postman 中,我通过 GET 链接点击了 id http://apactfs.cbre.com:8080/tfs/cbre.apac.applications/MRI_SCRUM_GIT/_workitems?_a=edit&id=61092&api-version=1.0

【问题讨论】:

    标签: rest tfs postman azure-devops-rest-api


    【解决方案1】:

    根据您的屏幕截图,61092 是 Product Backlog Item。您使用的Rest API URL只能获取工作项61092本身的详细信息,无法获取链接到61092的工作项的详细信息。

    您必须使用One-hop Query 获取与其相关的所有任务,然后获取返回的每个任务的详细数据。详情参考此链接:Get Work Items

    【讨论】:

      【解决方案2】:

      $expand=all 已经展开所有字段,但它没有显示空字段作为响应。如果您为要获取的字段键入一个值,您将看到它作为预期的响应。

      【讨论】:

      • 你能指定你想要哪个字段吗?
      猜你喜欢
      • 2018-07-23
      • 2018-07-24
      • 2017-07-19
      • 1970-01-01
      • 2018-12-17
      • 2016-11-16
      • 1970-01-01
      • 2018-09-08
      • 1970-01-01
      相关资源
      最近更新 更多