Skip to content

Create



POST /api/v1/issue/notification_policy/add

Overview

Create a notification policy.

Body Parameters

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

Parameter Details

1. Request Parameter Description

Parameter Name Type Required Description
name String Required Name.
notificationScheduleUUIDs Array Required List of associated schedules.
extend Json Extended information.

2. Parameter Description within extend

Parameter Name Type Required Description
notifyTypes Array Types that trigger notifications. Options: "issue.add", "issue.modify", "issueUpgrade.noManager", "issueUpgrade.processTimeout", "issueReply.add", "issueReply.modify", "issueReply.delete", "dailySummary", "issueUpgrade.eventStorm" (added in the 2025-05-28 iteration).
upgradeCfg Json Escalation time configuration when escalation notifications are enabled.

3. Parameter Description within extend.upgradeCfg

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 2025-02-19 iteration.
eventStorm Json Configure this field when issueUpgrade.eventStorm is enabled in extend.notifyTypes. Added in the 2025-05-28 iteration.

3.1 Internal structure and parameter description for noManager, processTimeout, openProcessTimeout, eventStorm within extend.upgradeCfg

Parameter Name Type Required Description
duration integer Trigger interval, unit: seconds.
notifyType string Notification type. Single: once, Recurring: cycle. Default is single. Added in the 2025-02-19 iteration.
cycleDuration integer Recurring notification frequency when notification type is recurring, unit: seconds. Added in the 2025-02-19 iteration.
cycleTimes integer Number of notifications when notification type is recurring, range: 1-30. Added in the 2025-02-19 iteration.
exceedTimes integer Threshold count for associated events in Issue escalation notification event storm. Added in the 2025-05-28 iteration.

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

Example of the extend.upgradeCfg field:

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