Skip to content

Create



POST /api/v1/issue/add

Overview

Body Request Parameters

Parameter Name Type Required Description
name string Y Title name
Example: name
Allow empty: False
Max length: 256
level string Y Level, corresponds to the uuid of the level configuration
Example: level
Allow empty: False
Allow empty string: True
description string Y Description
Example: description
Allow empty: False
attachmentUuids array List of uploaded attachment uuids
Example: []
Allow empty: True
extend json Y Additional extended information
Example: {}
Allow empty: True
resourceType string Source type, not required if no context exists
Example: resourceType
Allow empty: False
Allowed values: ['event', 'dashboard', 'viewer']
resourceUUID string Corresponding source uuid: docid, dashboardUUID, dashboardUUID
Example: resourceUuid
Allow empty: False
Allow empty string: True
resource string Source name brought in from the corresponding source
Example: resource
Allow empty: False
Allow empty string: True
channelUUIDs array Issue delivery tracking channel uuids
Example: []
Allow empty: True

Parameter Supplementary Explanation

Basic Parameter Description

Parameter Name Parameter Type Required Parameter Description
name string N Issue title name
level string N Issue level, corresponds to the configured level uuid
statusType integer N Issue status, 10: Open, 15: Working, 20: Resolved, 25: Closed, 30: Pending
description string N Issue description information
attachmentUuids array N List of uploaded attachment uuids, must be uploaded first via 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 UUID of the associated resource
resource string N Corresponding resource name
channelUUIDs array N List of resources expected for issue delivery, defaults to the default channel of the default workspace

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, indicates system level P0
P1 system_level_1 Pass parameter level: system_level_1, indicates system level P1
P2 system_level_2 Pass parameter level: system_level_2, indicates system level P2
P3 system_level_3 Pass parameter level: system_level_3, indicates system level P3
xxx issl_yyyyy Pass parameter level: issl_yyyyy, indicates custom level xxx

Issue Channel Explanation, all issues are automatically categorized in the default channel (All) 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 # in the description content: List of resources expected for issue delivery,
linkList array N Add issue links
members array N @ in the description content: Notification target members expected to be notified by the issue
manager array N Responsible person information (user account uuid, email, team uuid)
extra json N Issue creator/responsible person name and other information, used for frontend 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? ×