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, corresponding 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 Attachment upload list uuid
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
Optional 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
Example: resource
Allow empty: False
Allow empty string: True
channelUUIDs array Issue delivery tracking channel uuids
Example: []
Allow empty: True

Parameter Additional Explanation

Basic Parameter Explanation

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
description string N Issue description information
attachmentUuids array N Attachment upload list uuid, need to be uploaded via /api/v1/attachment/upload interface first
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 to default space default channel

Level Field Explanation Level is divided into system level/custom level (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 Explanation, all issues will be automatically classified in the default channel (all) The channels associated with the issue are: default channel (all), channels and channelUUIDs

Extended Field extend Explanation

Parameter Name Parameter Type Required Parameter Description
channels array N Description content #: expected issue delivery resource list
linkList array N Add issue link
members array N Description content @: expected issue notification notification target members
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 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": "Solve",
            "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? ×