Everyone,
I have been around and around about creating Visual Studio Team Services - Service Hook Subscriptions automagically via API. I can get the TFS publisher to work, but not the RM publisher. I am trying to create a hook subscription for Release Deployment Completed. Any examples I can find simply don't work even when swapped with my data. TFS provider works perfecty. Sample with response...
POST https://project.visualstudio.com/_apis/hooks/subscriptions?api-version=4.1-preview
Body:
{
"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"
}
}
Response:
{
"$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
}
It's because you missed vsrm in your url for a release. Use the following api and you'll get a successful response:
POST https://project.vsrm.visualstudio.com/_apis/hooks/subscriptions?api-version=4.1-preview
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With