Welcome to Cat2BugWelcome to Cat2Bug
Home
  • Cat2Bug-Platform
  • Cat2Bug-Platform
  • GitHub
  • Gitee
  • 简体中文
  • English
Home
  • Cat2Bug-Platform
  • Cat2Bug-Platform
  • GitHub
  • Gitee
  • 简体中文
  • English
  • Guide

    • Introduce
    • Experience
    • Rapid Deployment
    • /lang/us/document/cat2bug-platform/guide/update.html
  • Function

    • Member
    • Team
    • Project
    • Deliverable
    • Test Cases
    • Defect
    • Report
    • Document
    • /lang/us/document/cat2bug-platform/system/notice.html
  • API Interface

    • API Introduction
    • Defect Interface
    • Reporting Interface

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:

ParameterTypeRangeIllustrate
handlerStringThe value is a string of 0 to 30 bytesHandler
reportTitleStringRequired. 1 to 255 bytesReport Title
reportTimeLongRequiredReport Time
reportDescriptionStringRequired,1 to 65536 bytesReport Description
reportDataJSON ArrayNot requiredDefect Array

Description of format properties in the reportData array:

ParameterTypeRangeIllustrate
defectNameStringRequired. 1 to 128 bytesDefect Name
defectDescribeStringRequired. 1 to 65536 bytesDefect Describe
defectStateStringNot required. Default PROCESSING; PROCESSING, AUDIT, REJECTED, CLOSEDDefect State
defectTypeStringNot required. Default BUG; BUG, TASK, DEMANDDefect Type
defectLevelStringNot required. Default is MIDDLE; LOW, MIDDLE, HEIGHT, URGENTDefect Level
moduleVersionStringNot required. 1 to 128 bytesDeliverable version number
groupKeyStringNot required. 1 to 255 bytesDefects 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.
keyStringNot required. 1 to 255 bytesDefect 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

Last Updated:
Contributors: yuzhantao
Prev
Defect Interface