如何将工作项作为子项添加到父项?

编程入门 行业动态 更新时间:2024-10-23 07:28:18
本文介绍了如何将工作项作为子项添加到父项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经能够通过VSTS REST API找到有关创建工作项的文档,但是,我却找不到任何创建工作项并将其链接到父工作项的东西.

I've been able to find documentation on creating work items via the VSTS REST API, however, I haven't been able to find anything creating a work item and linking it to a Parent work item.

四处搜寻,我看到一些有关 System.LinkTypes.Hierarchy-Reverse 的链接,但是没有关于它如何工作的API参考,也没有关于如何将工作项链接到父工作的API参考.商品编号.链接此处

Searching around, I've seen some links regarding a System.LinkTypes.Hierarchy-Reverse, but no API reference on how it works, or how it might link a work item to a parent work item id. Link here

推荐答案

要添加链接了父级工作项的工作项,您应该使用REST API,如下所示:

To add a work item with parent work item linked, you should use the REST API as:

POST {accountName}.visualstudio/{project}/_apis/wit/workitems/${type}?api-version=4.1

application/json-patch + json:

application/json-patch+json:

[ { "op": "add", "path": "/fields/System.Title", "from": null, "value": "title"}, { "op": "add", "path": "/relations/-", "value": { "rel": "System.LinkTypes.Hierarchy-Reverse", "url": "URL for the parent work item" } } ]

下面是创建链接了父工作项目(工作项目ID为 184 )的任务 mytask 的示例:

Below is the example to create a task mytask with parent work item (work item id is 184) linked:

POST marinaliu.visualstudio/Git2/_apis/wit/workitems/$Task?api-version=4.1

application/json-patch + json:

application/json-patch+json:

[ { "op": "add", "path": "/fields/System.Title", "from": null, "value": "mytask"}, { "op": "add", "path": "/relations/-", "value": { "rel": "System.LinkTypes.Hierarchy-Reverse", "url": "marinaliu.visualstudio/f7855e29-6f8d-429d-8c9b-41fd4d7e70a4/_apis/wit/workItems/184" } } ]

更多推荐

如何将工作项作为子项添加到父项?

本文发布于:2023-11-23 15:52:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622022.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何将   工作   到父项

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!