【发布时间】:2018-06-25 19:49:54
【问题描述】:
大家,
我一直致力于通过 API 自动创建 Visual Studio 团队服务 - 服务挂钩订阅。我可以让 TFS 发布者工作,但不能让 RM 发布者工作。我正在尝试为发布部署已完成创建挂钩订阅。即使与我的数据交换,我能找到的任何示例都无法正常工作。 TFS 提供程序完美运行。响应样本...
POST https://project.visualstudio.com/_apis/hooks/subscriptions?api-version=4.1-preview
主体:
{
"publisherId": "rm",
"eventType": "ms.vss-release.deployment-completed-event",
"consumerId": "slack",
"consumerActionId": "postMessageToChannel",
"publisherInputs": {
"releaseEnvironmentId" : "777",
"releaseDefinitionId" : "1",
"releaseEnvironmentStatus" : "4",
"projectId" : "6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c"
},
"consumerInputs": {
"url": "https://hooks.slack.com/services/myservice/crazyGuidxxxxxxxxxxxxxxxx"
}
}
回复:
{
"$id": "1",
"innerException": null,
"message": "There is no registered handler for the service hooks event type ms.vss-release.deployment-completed-event.",
"typeName": "System.InvalidOperationException, mscorlib",
"typeKey": "InvalidOperationException",
"errorCode": 0,
"eventId": 0
}
【问题讨论】:
-
在你的url中添加vsrm后能解决这个问题吗?
-
是的,这解决了问题。非常感谢!
标签: visual-studio tfs azure-devops azure-pipelines-release-pipeline azure-devops-rest-api