Webhook有效负载说明

时间:2020-01-29 14:10:25

标签: azure-devops

从文档挂钩和示例服务挂钩看,几乎没有关于有效载荷内容的解释。

例如,我创建了一个Release Released和一个Release Completed Service钩子,当我查看有效负载时,所包含的GUID都不代表触发警报的发布管道的ID。

这是我收到的模糊负载:

{
    "subscriptionId": "000-000-000-000-000",
    "notificationId": 12,
    "id": "000-000-000-000-000",
    "eventType": "ms.vss-release.deployment-started-event",
    "publisherId": "rm",
    "message": {
        "text": "Deployment of release Release-430 to stage Test started.",
        "html": "Deployment on stage <a href='https://TESTAcentral.visualstudio.com/TESTA/_release?_a=environment-summary&definitionId=34&definitionEnvironmentId=12'>Test</a> started.",
        "markdown": "Deployment on stage [Test](https://TESTAcentral.visualstudio.com/TESTA/_release?_a=environment-summary&definitionId=34&definitionEnvironmentId=12) started."
    },
    "detailedMessage": {
        "text": "Deployment of release Release-430 on stage Test started.\r\nTrigger: After successful deployment of Dev",
        "html": "Deployment on stage <a href='https://TESTAcentral.visualstudio.com/TESTA/_release?_a=environment-summary&definitionId=34&definitionEnvironmentId=12'>Test</a> started.<br>Trigger: After successful deployment of Dev",
        "markdown": "Deployment on stage [Test](https://TESTAcentral.visualstudio.com/TESTA/_release?_a=environment-summary&definitionId=34&definitionEnvironmentId=12) started.\r\nTrigger: After successful deployment of Dev"
    },
    "resourceVersion": null,
    "resourceContainers": {
        "collection": {
            "id": "000-000-000-000-000",
            "baseUrl": "https://TESTAcentral.vsrm.visualstudio.com/"
        },
        "account": {
            "id": "000-000-000-000-000",
            "baseUrl": "https://TESTAcentral.vsrm.visualstudio.com/"
        },
        "project": {
            "id": "000-000-000-000-000",
            "baseUrl": "https://TESTAcentral.vsrm.visualstudio.com/"
        }
    },
    "createdDate": "2020-01-29T13:49:01.1293269Z",
    "resource": null
}

我应该如何识别实际触发此Webhook的管道?

请不要告诉我,这样做的目的是解析markdown或html字段并分解该URL。如果您不包含触发标识符,则会损害整个过程的实用性!

1 个答案:

答案 0 :(得分:1)

更新

这是由服务挂钩中的新UI引起的问题。

暂时的解决方法是关闭“预览功能”中的“服务挂钩设置页面改进预览”

enter image description here