Skip to content

Create Issues



POST /api/v1/issue/add

Overview

Body Request Parameters

Parameter Name Type Required Description
name string Y Title name
Example: name
Allow empty: False
Maximum length: 256
level string Y Level, corresponding to the level configuration UUID
Example: level
Allow empty: False
Allow empty string: True
description string Y Description
Example: description
Allow empty: False
attachmentUuids array List of uploaded attachments UUIDs
Example: []
Allow empty: True
extend json Y Additional extended information
Example: {}
Allow empty: True
resourceType string Source type, no need to pass if there is no scenario
Example: resourceType
Allow empty: False
Possible values: ['event', 'dashboard', 'viewer']
resourceUUID string Corresponding source UUID respectively docid, dashboardUUID, dashboardUUID
Example: resourceUuid
Allow empty: False
Allow empty string: True
resource string Corresponding source name brought in from the source
Example: resource
Allow empty: False
Allow empty string: True
channelUUIDs array Issue delivery tracking channel UUIDs
Example: []
Allow empty: True

Supplementary Parameter Explanation

Basic Parameter Description

Parameter Name Parameter Type Required Parameter Description
name string N Issue title name
level string N Issue level corresponding to the configured level UUID
statusType integer N Issue status, 10: Open, 15: Working, 20: Resolved, 25: Closed, 30: Pending
decription string N Issue description information
attachmentUuids array N Uploaded attachment list UUID, needs to be uploaded first through the /api/v1/attachment/upload interface
extend json N Extended field, default pass {}
resourceType string N event: Event, dashboard: Dashboard, viewer: Viewer (checker: Monitor, this type is automatically created)
resourceUUID string N Resource associated UUID
resource string N Corresponding resource name
channelUUIDs array N Expected issue delivery resource list, default delivery default space default channel

Level Field Description Level is divided into system levels/custom levels (can be configured in Configuration Management)

Level Value Parameter Description
P0 system_level_0 Pass parameter level: system_level_0, indicating system level P0
P1 system_level_1 Pass parameter level: system_level_1, indicating system level P1
P2 system_level_2 Pass parameter level: system_level_2, indicating system level P2
P3 system_level_3 Pass parameter level: system_level_3, indicating system level P3
xxx issl_yyyyy Pass parameter level: issl_yyyyy, indicating custom level xxx

Issue Channel Description, all issues will automatically be categorized under the default channel (All) The channels associated with the issue are: Default channel (All), channels and channelUUIDs

Extended Field Extend Description

Parameter Name Parameter Type Required Parameter Description
channels array N Description content's #: Expected issue delivery resource list,
linkList array N Add issue links
members array N Description content's @: Expected notification target members for the issue
manager array N User account UUID, email, team UUID
extra json N Information about the creator/responsible person for the issue, used for front-end display

Extend field example:

{
    "members": [
        {
            "type": "@",
            "uuid": "acnt_xxxx32",
            "exists": true
        }
    ],
    "channels": [
        {
            "type": "#",
            "uuid": "chan_xxxx32",
            "exists": true
        }
    ],
    "manager": [
        "acnt_xxxx32",
        "xxx@guance.com",
        "group_xxx"
    ],
    "linkList": [
        {
            "name": "Resolve",
            "link": "https://sd.com",
        }
    ],
    "extra": {
            "creator": {
                "name": "xxx",
                "email": "xxx@guance.com",
            },
            "managerInfos": {
                "xxx@guance.com": {"name": "111"},
                "xxx@guance.com": {"name": "222"}

            }
            }
}

Request Example

curl 'https://openapi.guance.com/api/v1/issue/add' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"name":"dcacscsc","level":"system_level_2","description":"<span>cdscascas</span>","extend":{"channels":[{"type":"#","uuid":"chan_xxxx32"}],"view_isuue_url":"/exceptions/exceptionsTracking?leftActiveKey=ExceptionsTracking&activeName=ExceptionsTracking&w=wksp_xxxx32&classic=exceptions_tracing&issueName=SYS&activeChannel=%7BdefaultChannelUUID%7D&sourceType=exceptions_tracing&__docid=%7BissueUUID%7D"},"attachmentUuids":[]}'\
--compressed

Response

{
    "code": 200,
    "content": {
        "createAt": 1686398344,
        "creator": "acnt_xxxx32",
        "creatorInfo": {
            "acntWsNickname": "",
            "email": "xxx@guance.com",
            "iconUrl": "",
            "name": "wanglei-testing",
            "username": "xxx@guance.com"
        },
        "deleteAt": -1,
        "description": "",
        "extend": {
            "channels": [
                {
                    "exists": true,
                    "type": "#",
                    "uuid": "chan_xxxx32"
                }
            ],
            "view_isuue_url": ""
        },
        "id": 47402,
        "level": "system_level_2",
        "name": "dcacscsc",
        "resource": "",
        "resourceType": "",
        "resourceUUID": "",
        "status": 0,
        "statusType": 20,
        "subIdentify": "",
        "updateAt": 1686400483,
        "updator": "acnt_xxxx32",
        "updatorInfo": {
            "acntWsNickname": "",
            "email": "xxx@guance.com",
            "iconUrl": "",
            "name": "wanglei-testing",
            "username": "xxx@guance.com"
        },
        "uuid": "issue_xxxx32",
        "workspaceUUID": "wksp_xxxx32"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "1744405827768254151"
} 

Feedback

Is this page helpful? ×