Skip to content

Create



POST /api/v1/issue/notification_policy/add

Overview

Create notification policies

Body Request Parameters

Parameter Name Type Required Description
name string Y Notification policy name
Allow empty: False
Maximum 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 and 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

Additional Parameter Notes

1. Request Parameter Notes

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

2. **extend Parameter Notes

Parameter Name type Required Description
notifyTypes Array Notification trigger types, options: "issue.add","issue.modify","issueUpgrade.noManager","issueUpgrade.processTimeout","issueReply.add","issueReply.modify","issueReply.delete","dailySummary"
upgradeCfg Json Upgrade time configuration when notifications exist in the notification type

3. **extend.upgradeCfg Parameter Notes

Parameter Name 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, added in the iteration on February 19, 2025

3.1 **extend.upgradeCfg noManager, processTimeout, openProcessTimeout have the same internal structure, parameter notes

Parameter Name type Required Description
duration integer Trigger time interval, unit s
notifyType string Notification type, single: once, loop: cycle, default single, added in the iteration on February 19, 2025
cycleDuration integer Notification frequency during cyclic notifications, unit s, added in the iteration on February 19, 2025
cycleTimes integer Number of notifications during cyclic notifications, 1-30, added in the iteration on February 19, 2025

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"
    }
}


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? ×