Skip to content

Create



POST /api/v1/issue/notification_policy/add

Overview

Create Notification Policy

Body Parameters

Parameter Type Required Description
name string Y Notification policy name
Allow empty: False
Max length: 256
Allow empty string: False
notificationScheduleUUIDs array List of notification schedule UUIDs
Example: ['nsche_xxx', 'nsche_yyy']
Allow empty: False
extend json Extended information, includes notification scope, upgrade configuration
Allow empty: False
extend.notifyTypes array Notification types
Example: ['issue.add', 'issue.modify', 'issueUpgrade.noManager', 'issueUpgrade.processTimeout', 'issueReply.add', 'issueReply.modify', 'issueReply.delete', 'dailySummary']
Allow empty: False
extend.upgradeCfg json Upgrade configuration
Allow empty: False

Parameter Supplementary Explanation

1. Request Parameter Description

Parameter type Required Description
name String Required Name
notificationScheduleUUIDs Array Required Associated schedule list
extend Json Extended information

2. **extend Parameter Description

Parameter type Required Description
notifyTypes Array Notification trigger types, options: "issue.add","issue.modify","issueUpgrade.noManager","issueUpgrade.processTimeout","issueReply.add","issueReply.modify","issueReply.delete","dailySummary", "issueUpgrade.eventStorm"(Iteration added 2025-05-28)
upgradeCfg Json Notification type upgrade time configuration when upgrade notification exists

3. **extend.upgradeCfg Parameter Description

Parameter type Required Description
noManager Json Configure this field when issueUpgrade.noManager is enabled in extend.notifyTypes
processTimeout json Configure this field when issueUpgrade.processTimeout is enabled in extend.notifyTypes
openProcessTimeout Json Configure this field when issueUpgrade.processTimeout is enabled in extend.notifyTypes, iteration added 2025-02-19
eventStorm Json Configure this field when issueUpgrade.eventStorm is enabled in extend.notifyTypes, iteration added 2025-05-28

3.1 **extend.upgradeCfg Internal structure of noManager, processTimeout, openProcessTimeout, eventStorm, Parameter Description

Parameter type Required Description
duration integer Trigger time interval, unit s
notifyType string Notification type, single: once, cycle: cycle, default single, iteration added 2025-02-19
cycleDuration integer Cycle notification frequency when cyclic notification, unit s, iteration added 2025-02-19
cycleTimes integer Number of notifications when cyclic notification, 1-30, iteration added 2025-02-19
exceedTimes integer Threshold count of related events for event storm in Issue upgrade notification, iteration added 2025-05-28

Note: When issueUpgrade.processTimeout is enabled in extend.notifyTypes, both processTimeout and openProcessTimeout in extend.upgradeCfg can be configured simultaneously

extend.upgradeCfg Field Example:

{
    "noManager": {
        "duration": 600
    },
    "processTimeout": {
        "duration": 600,
        "cycleDuration": 600,
        "notifyType": "cycle",
        "cycleTimes": 10
    },
    "openProcessTimeout": {
        "duration": 600,
        "notifyType": "once"
    },
    "eventStorm": {
        "exceedTimes": 60,
        "notifyType": "once"
    }
}


Request Example

curl 'https://openapi.guance.com/api/v1/issue/notification_policy/add' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"name":"api_add test","notificationScheduleUUIDs":["nsche_a15990d7e6ec4514842dbee74e26a1cf"],"extend":{"notifyTypes":["issue.add","issue.modify","issueUpgrade.noManager","issueReply.add","issueReply.modify"],"upgradeCfg":{"noManager":{"duration":1200},"processTimeout":{}}}}' \
--compressed

Response

{
    "code": 200,
    "content": {
        "createAt": 1735801143,
        "creator": "wsak_f2ba9858f4414655be39efc882b120dd",
        "declaration": {},
        "deleteAt": -1,
        "extend": {
            "notifyTypes": [
                "issue.add",
                "issue.modify",
                "issueUpgrade.noManager",
                "issueReply.add",
                "issueReply.modify"
            ],
            "upgradeCfg": {
                "noManager": {
                    "duration": 1200
                },
                "processTimeout": {}
            }
        },
        "id": null,
        "name": "api_add test",
        "notificationScheduleUUIDs": [
            "nsche_a15990d7e6ec4514842dbee74e26a1cf"
        ],
        "status": 0,
        "updateAt": null,
        "updator": null,
        "uuid": "inpy_c79b26b3f6a540888f1773317093c0bd",
        "workspaceUUID": "wksp_798c5e0f589e4992994196832f64b6ba"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-844F87BE-34E5-4C96-B2AC-65A2433011BC"
} 

Feedback

Is this page helpful? ×