【问题标题】:How to create a work item in TFS 2015 via REST usinging SoapUI如何使用 SoapUI 通过 REST 在 TFS 2015 中创建工作项
【发布时间】:2018-06-13 10:41:29
【问题描述】:

我是 SoapUI 和一般 REST 测试的新手。我正在尝试通过 REST 调用在 TFS 中创建一个 BUG 工作项。我发现的示例说要使用 PATCH 方法,但是当我在 SOAPUI 中这样做时,如果出现以下错误: { "$id": "1", “内部异常”:空, "message": "您必须在请求正文中传递一个有效的补丁文件。", “typeName”:“Microsoft.VisualStudio.Services.Common.VssPropertyValidationException,Microsoft.VisualStudio.Services.Common,版本=14.0.0.0,文化=中性,PublicKeyToken=b03f5f7f11d50a3a”, "typeKey": "VssPropertyValidationException", “错误代码”:0, “eventId”:3000

你真的可以使用 PATCH 创建一个新的 Workitem 吗?

这是我要发送的内容:

补丁http://tfs-app-t1.xxx.xxxx.com:8080/tfs/DEV%20xxx%20xxxxx%20xxxxxxx/XXX-East%20Region/_apis/wit/workitems/$bug?api-version=1.0

内容类型:application/json-patch+json

[ { “操作”:“添加”, "路径": "/fields/System.Title", "value": "测试来自 Rest Call 的 bug" } { “操作”:“添加”, "路径": "/fields/System.Workstream", “价值”:“EDI” }
]

我试图从示例中删除服务器名称

【问题讨论】:

    标签: rest tfs tfs-2015


    【解决方案1】:

    我终于找到了问题所在。我在 2 个 {} 集之间缺少一个逗号。应该是:

    我是 SoapUI 和一般 REST 测试的新手。我正在尝试通过 REST 调用在 TFS 中创建一个 BUG 工作项。我发现的示例说要使用 PATCH 方法,但是当我在 SOAPUI 中这样做时,如果收到以下错误:{ "$id": "1", "innerException": null, "message": "You must pass a valid请求正文中的补丁文件。", "typeName": "Microsoft.VisualStudio.Services.Common.VssPropertyValidationException, Microsoft.VisualStudio.Services.Common, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", " typeKey”:“VssPropertyValidationException”,“errorCode”:0,“eventId”:3000

    你真的可以使用 PATCH 创建一个新的 Workitem 吗?

    这是我要发送的内容:

    补丁http://tfs-app-t1.xxx.xxxx.com:8080/tfs/DEV%20xxx%20xxxxx%20xxxxxxx/XXX-East%20Region/_apis/wit/workitems/$bug?api-version=1.0

    Content-Type: application/json-patch+json

    [ { "op": "add", "path": "/fields/System.Title", "value": "Test bug from Rest Call" }, { "op": "add", "path ": "/fields/System.Workstream", "value": "EDI" } ]

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-14
      • 2020-03-02
      • 2017-07-20
      • 2016-09-03
      • 2015-10-01
      • 2016-05-07
      • 1970-01-01
      • 2016-04-15
      相关资源
      最近更新 更多