Reporting Interface
Push Defect Report
Interface Path: /api/report/defect
Method: POST
Request parameter
{
"handler": "demo",
"reportTitle": "单元测试报告:com.cat2bug.junit.demo.Cat2BugRunnerTest",
"reportTime": 1711546667143,
"reportDescription": "报告描述",
"reportData": [
{
"defectName": "[testRuleFalse(com.cat2bug.junit.demo.Cat2BugRunnerTest)]",
"defectDescribe": "缺陷描述",
"defectState": "PROCESSING",
"defectType": "BUG",
"defectLevel": "middle",
"moduleVersion":"0.0.1",
"groupKey": "com.cat2bug.junit.demo.Cat2BugRunnerTest",
"key": "com.cat2bug.junit.demo.Cat2BugRunnerTest.testRuleFalse"
}
]
}
Request parameter description:
Parameter | Type | Range | Illustrate |
---|---|---|---|
handler | String | The value is a string of 0 to 30 bytes | Handler |
reportTitle | String | Required. 1 to 255 bytes | Report Title |
reportTime | Long | Required | Report Time |
reportDescription | String | Required,1 to 65536 bytes | Report Description |
reportData | JSON Array | Not required | Defect Array |
Description of format properties in the reportData array:
Parameter | Type | Range | Illustrate |
---|---|---|---|
defectName | String | Required. 1 to 128 bytes | Defect Name |
defectDescribe | String | Required. 1 to 65536 bytes | Defect Describe |
defectState | String | Not required. Default PROCESSING; PROCESSING, AUDIT, REJECTED, CLOSED | Defect State |
defectType | String | Not required. Default BUG; BUG, TASK, DEMAND | Defect Type |
defectLevel | String | Not required. Default is MIDDLE; LOW, MIDDLE, HEIGHT, URGENT | Defect Level |
moduleVersion | String | Not required. 1 to 128 bytes | Deliverable version number |
groupKey | String | Not required. 1 to 255 bytes | Defects Unique key group. This property finds defects in the same group. If the class name of a class is used as a groupKey, and no problems are found in this class after testing, you can use the groupKey attribute to change the defect status of all such associations. |
key | String | Not required. 1 to 255 bytes | Defect unique keyword |
- Return value. code returns 200, indicating successful push.
{
"msg":"操作成功",
"code":200
}
- Examples
curl --location -X POST 'https://www.cat2bug.com:8022/prod-api/api/report/defect' \
-H 'Content-Type: application/json' \
-H 'CAT2BUG-API-KEY: 20240327001413he1mbyfi6fhnfets' \
-d '{"handler":"demo","reportTitle":"单元测试报告:com.cat2bug.junit.demo.Cat2BugRunnerTest","reportTime":1711546667143,"reportDescription":"报告描述","reportData":[{"defectName":"[testRuleFalse(com.cat2bug.junit.demo.Cat2BugRunnerTest)]","defectDescribe":"缺陷描述","defectState":"PROCESSING","defectType":"BUG","defectLevel":"middle","groupKey":"com.cat2bug.junit.demo.Cat2BugRunnerTest","key":"com.cat2bug.junit.demo.Cat2BugRunnerTest.testRuleFalse"}]}'
Prompt
Please replace the interface IP, port, and CAT2BUG-API-KEY key in the example