Create Large Amount of Work Items in TFS Using Javascript REST API

旧街凉风 提交于 2019-12-02 11:48:30

Using Work item batch api instead:

For example:

http://[collection url]/_apis/wit/$batch?api-version=1.0

Body:

[
  {
    "method": "PATCH",
    "uri": "/ScrumStarain/_apis/wit/workItems/$Product Backlog Item?api-version=1.0",
    "headers": {
      "Content-Type": "application/json-patch+json"
    },
    "body": [
      {
        "op": "add",
        "path": "/fields/System.Title",
        "value": "apip1"
      },
      {
        "op": "add",
        "path": "/id",
        "value": "-1"
      }
    ]
  },
  {
    "method": "PATCH",
    "uri": "/ScrumStarain/_apis/wit/workItems/$Task?api-version=1.0",
    "headers": {
      "Content-Type": "application/json-patch+json"
    },
    "body": [
      {
        "op": "add",
        "path": "/fields/System.Title",
        "value": "apip2"
      },
      {
        "op": "add",
        "path": "/id",
        "value": "-2"
      }

    ]
  }
]

More information, you can refer to: Work item batch operations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!