Skip to content

Create



POST /api/v1/issue/notification_policy/add

Overview

Create Notification Policy

Body Request Parameters

Parameter Name Type Required Description
name string Y Notification policy name
Allow empty: False
Max length: 256
Allow empty string: False
notificationScheduleUUIDs array Notification schedule UUID list
Example: ['nsche_xxx', 'nsche_yyy']
Allow empty: False
extend json Extension 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 Additional Notes

1. Request Parameter Description

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

2. **extend Parameter Description

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", "issueUpgrade.eventStorm"(2025-05-28 iteration added)
upgradeCfg Json Notification type upgrade time configuration when upgrade notification is enabled

3. **extend.upgradeCfg Parameter Description

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

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

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

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

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