ADO 将要求和测试用例工作项与 Rest API 问题链接



我试图将ADO需求工作项链接到ADO测试用例工作项。我正在打这个电话:

curl -u :********** -X PATCH -H "Content-Type: application/json-patch+json"  -H "Accept: application/json-patch+json" -d "[{{"op": "test", "path": "/rev","value": 3 },{"op": "add", "path": "/relations/-", "value":"{"rel": "System.LinkTypes.Dependency-forward","url": "https://***.***.com/{Organisation}/_apis/wit/workItems/{ID}","attributes": {"comment": "Making a new link for the dependency"}}}}]" https://***.***.com/{Organisation}/{Project}/_apis/wit/workItems/{ID}?api-version=6.0

按:https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/update?view=azure-devops-rest-7.1#add-a-link

但是我有这个错误:

{"$id":"1","innerException":null,"message":","typeName"; "Microsoft.VisualStudio.Services.Common。VssPropertyValidationException Microsoft.VisualStudio.Services.Common"typeKey":"VssPropertyValidationException","errorCode": 0,"eventId": 3000}

我找到了我的答案,JSON是糟糕的解析。我使用了一个在线JSON过滤器来修复它。https://jsonlint.com/

curl -u :********** -X PATCH -H "Content-Type: application/json-patch+json"  -H "Accept: application/json-patch+json" -d "[{"op": "add", "path": "/relations/-", "value":{"rel": "Microsoft.VSTS.Common.TestedBy-Forward","url": "https://***.***.com/{Organisation}/_apis/wit/workItems/{ID}","attributes": {"comment": "Making a new link for the dependency"}}}]" https://***.***.com/{Organisation}/{Project}/_apis/wit/workItems/{ID}?api-version=6.0

最新更新