- 入门指南
- 项目管理
- 项目操作和实用程序
- Test Manager 设置
- ALM 工具集成
- API 集成

Test Manager 用户指南
Webhooks
Test Manager 提供了 Webhook,允许外部工具订阅 Test Manager 中的事件。
目前,支持以下事件。
- 创建缺陷:每当用户从测试用例结果中调用“创建缺陷”任务时,都会触发此事件。它允许外部缺陷管理工具从测试结果中接收带有日志信息的缺陷报告。
- 缺陷 KPI:刷新 Test Manager 仪表板上的缺陷 KPI 时调用此事件。这允许加入来自外部缺陷管理系统的统计信息,以显示在 Test Manager 仪表板上。
合同
在本节中,您可以找到每个事件的请求和响应有效负载详细信息。
创建缺陷。
Test Manager 使用以下有效负载触发已注册的 Webhook:
使用 Test Manager REST API 获取有关失败测试的详细信息,以将信息添加到创建的缺陷中。
Request:
CreateDefectFromTestCaseLogRequest{
testExecutionId string($uuid)
testCaseId string($uuid)
variationId string
nullable: true
linkToTestCaseLog string
nullable: true
}
Response:
Returns a defect payload to allow Test Manager to add a link to the created defect in the test case log.
Request:
CreateDefectFromTestCaseLogRequest{
testExecutionId string($uuid)
testCaseId string($uuid)
variationId string
nullable: true
linkToTestCaseLog string
nullable: true
}
Response:
Returns a defect payload to allow Test Manager to add a link to the created defect in the test case log.
缺陷 KPI
Test Manager 使用以下有效负载触发已注册的 Webhook:
Request:
api/kpis/project/<projectid>/defectstatus
Response:
KPIConnectorDefectsDto{
totalDefects integer($int32)
criticalDefects integer($int32)
moderateDefects integer($int32)
openDefects integer($int32)
closedDefects integer($int32)
status ConnectorKPIStatusstring
Enum:
Array [ 3 ]
criticalDefectsLink string
nullable: true
}
Request:
api/kpis/project/<projectid>/defectstatus
Response:
KPIConnectorDefectsDto{
totalDefects integer($int32)
criticalDefects integer($int32)
moderateDefects integer($int32)
openDefects integer($int32)
closedDefects integer($int32)
status ConnectorKPIStatusstring
Enum:
Array [ 3 ]
criticalDefectsLink string
nullable: true
}
配置 Webhook 连接
- 以管理员身份登录 Test Manager。
- 打开项目。
- Navigate to Project Settings > Integration.
- Click New Connection and select WebHook from the dropdown.
- 配置以下连接设置:
-
Name: Enter a name for your WebHook connection.
-
说明(可选): 添加说明以供参考。
-
Payload URL: Add the endpoint server URL. For example:
https://company-name-serverRegion.cloudapp.azure.com. -
Authentication Header Type: Select a hashing method between
Client SecretandHMACSHA256. -
Secret: Enter your client secret value.
-
Allow Insecure SSL: Choose whether to allow endpoints with insecure SSL connections.
-
Supports Defect Dashboard: Choose if KPIs needs to be shown in the project dashboard.

-
- 单击“保存”。
- 单击连接以展开面板并复制 API 密钥以备后用。
管理 WebHook 连接
下表列出了可以用来管理 WebHooks 连接的操作。
| 操作 | 描述 | 程序 |
|---|---|---|
| 编辑 | 编辑连接设置。 |
|
| 删除 | 删除选定的连接及其关联的要求。 |
|