Skip to content

Create



POST /api/v1/issue/notification_policy/add

Overview

Create a notification policy and configure the Issue notification scope, schedules, and escalation rules.

Prerequisites and Usage Steps

At minimum, submit a non-empty name and notificationScheduleUUIDs: [] when creating; this array is still optional in the runtime declaration, but currently omitting it may return 500 after the policy body has already been saved, so clients should pass the array explicitly. Use [] when not associating any schedule; to actually produce notifications, you must also select actual schedules, notification types, and the required escalation configuration. It is recommended to configure complete escalation rules at creation time. The policy must be associated with the target channel in the console and with valid notification schedules; the actual recipients are determined by the schedule's time zone, time slot of the day, validity period, rotation, and notification targets. Saving the policy itself does not immediately send a test notification. Escalation is checked by a site scheduled task and is not an exact countdown; only Issues created after the trigger configuration is created or updated are checked. If a schedule has no valid targets at that moment, a trigger may still be recorded, so do not treat trigger counts as delivery counts; verify both the notification targets and the actual messages. The policy body, associations, and escalation trigger configuration are saved in separate steps. After a failure or timeout, read the details first to confirm existing changes, then decide whether to retry.

Request Headers

Parameter Type Required Description
DF-API-KEY string Y OpenAPI authentication credential for the workspace.
Example: <DF-API-KEY>
How to obtain or fill in: Obtain an OpenAPI Key with the required permissions from API Key management in the target workspace.

Body Request Parameters

Parameter Type Required Description
notificationScheduleUUIDs[*] string A single notification schedule UUID. A notification target UUID cannot be used instead.
Example: nsche_example
How to obtain or fill in: Copy a single schedule UUID from Notification Schedule List; you can use Notification Schedule Details to confirm the configuration and targets.
extend.notifyTypes[*] string A single trigger type. openProcessTimeout is also enabled by issueUpgrade.processTimeout; do not pass issueUpgrade.openProcessTimeout separately.
Example: issueUpgrade.eventStorm
How to obtain or fill in: Select one of the event types above according to the trigger intent; the event type itself does not specify recipients.
extend.upgradeCfg.noManager json When an Issue has no valid assignee at creation and enters the no-assignee candidate set while its status is Open/Working/Pending, the wait starts from Issue creation; for existing Issues, merely removing the assignee does not guarantee re-entry into the candidate set. Enter a positive integer number of seconds that is a multiple of 60. Omitting this field or passing an empty object does not enable the rule.
Example: {"duration": 600, "notifyType": "once"}
How to obtain or fill in: After including issueUpgrade.noManager in extend.notifyTypes, fill in according to business expectations.
extend.upgradeCfg.noManager.duration integer Required when enabled: a positive integer number of seconds, must be a multiple of 60, maximum 31622400 seconds; omitting it or passing 0 does not create the rule.
Example: 600
How to obtain or fill in: Convert the expected business wait time to seconds, for example 600 means 10 minutes.
extend.upgradeCfg.noManager.notifyType string Notification mode, once or cycle; defaults to once when omitted.
Example: once
How to obtain or fill in: Use once to notify only once; use cycle when repeated check-and-send is required.
extend.upgradeCfg.noManager.cycleDuration integer Required in cycle mode: the cycle interval in seconds; it does not add to duration each time, and actual timing is also affected by the scheduled task and schedule validity.
Example: 600
How to obtain or fill in: In cycle mode, select a positive integer interval in seconds, for example 600 means 10 minutes; omit it in once mode.
extend.upgradeCfg.noManager.cycleTimes integer Required in cycle mode: the maximum number of triggers, including the first one. Valid range is 1 to 30; recorded counts do not equal successful deliveries.
Example: 3
How to obtain or fill in: In cycle mode, enter an integer from 1 to 30; omit it in once mode.
extend.upgradeCfg.processTimeout json The continuous unfinished time while an Issue is in Open/Working. The first timer starts from creation; when the Issue re-enters a processing status from Pending/Resolved/Closed, timing starts from the status record after re-entry. Omitting this field or passing an empty object does not enable the rule.
Example: {"duration": 1800, "notifyType": "cycle", "cycleDuration": 600, "cycleTimes": 3}
How to obtain or fill in: After including issueUpgrade.processTimeout in extend.notifyTypes, fill in according to business expectations.
extend.upgradeCfg.processTimeout.duration integer Required when enabled: a positive integer number of seconds, must be a multiple of 60, maximum 31622400 seconds; omitting it or passing 0 does not create the rule.
Example: 1800
How to obtain or fill in: Convert the expected business wait time to seconds, for example 600 means 10 minutes.
extend.upgradeCfg.processTimeout.notifyType string Notification mode, once or cycle; defaults to once when omitted.
Example: cycle
How to obtain or fill in: Use once to notify only once; use cycle when repeated check-and-send is required.
extend.upgradeCfg.processTimeout.cycleDuration integer Required in cycle mode: the cycle interval in seconds; it does not add to duration each time, and actual timing is also affected by the scheduled task and schedule validity.
Example: 600
How to obtain or fill in: In cycle mode, select a positive integer interval in seconds, for example 600 means 10 minutes; omit it in once mode.
extend.upgradeCfg.processTimeout.cycleTimes integer Required in cycle mode: the maximum number of triggers, including the first one. Valid range is 1 to 30; recorded counts do not equal successful deliveries.
Example: 3
How to obtain or fill in: In cycle mode, enter an integer from 1 to 30; omit it in once mode.
extend.upgradeCfg.openProcessTimeout json Takes effect only while the Issue remains Open, timed from the last status change; if there is no status record, timed from creation. Omitting this field or passing an empty object does not enable the rule.
Example: {"duration": 900, "notifyType": "once"}
How to obtain or fill in: After including issueUpgrade.processTimeout in extend.notifyTypes, fill in according to business expectations.
extend.upgradeCfg.openProcessTimeout.duration integer Required when enabled: a positive integer number of seconds, must be a multiple of 60, maximum 31622400 seconds; omitting it or passing 0 does not create the rule.
Example: 900
How to obtain or fill in: Convert the expected business wait time to seconds, for example 600 means 10 minutes.
extend.upgradeCfg.openProcessTimeout.notifyType string Notification mode, once or cycle; defaults to once when omitted.
Example: once
How to obtain or fill in: Use once to notify only once; use cycle when repeated check-and-send is required.
extend.upgradeCfg.openProcessTimeout.cycleDuration integer Required in cycle mode: the cycle interval in seconds; it does not add to duration each time, and actual timing is also affected by the scheduled task and schedule validity.
Example: 600
How to obtain or fill in: In cycle mode, select a positive integer interval in seconds, for example 600 means 10 minutes; omit it in once mode.
extend.upgradeCfg.openProcessTimeout.cycleTimes integer Required in cycle mode: the maximum number of triggers, including the first one. Valid range is 1 to 30; recorded counts do not equal successful deliveries.
Example: 3
How to obtain or fill in: In cycle mode, enter an integer from 1 to 30; omit it in once mode.
extend.upgradeCfg.eventStorm json Triggers after the Issue record's eventCount is strictly greater than exceedTimes; it is not limited by Open/Working status, so completed Issues may also satisfy the count condition. Omitting this field or passing an empty object does not enable the rule.
Example: {"exceedTimes": 60, "notifyType": "once"}
How to obtain or fill in: After including issueUpgrade.eventStorm in extend.notifyTypes, fill in according to business expectations.
extend.upgradeCfg.eventStorm.exceedTimes integer Event count threshold, not a time value; required when enabled, a positive integer no greater than 31622400.
Example: 60
How to obtain or fill in: Set a positive integer threshold based on the acceptable number of associated events, for example 60 means the rule triggers only when eventCount exceeds 60.
extend.upgradeCfg.eventStorm.notifyType string Notification mode, once or cycle; defaults to once when omitted.
Example: once
How to obtain or fill in: Use once to notify only once; use cycle when repeated check-and-send is required.
extend.upgradeCfg.eventStorm.cycleDuration integer Required in cycle mode: the cycle interval in seconds; it does not add to duration each time, and actual timing is also affected by the scheduled task and schedule validity.
Example: 600
How to obtain or fill in: In cycle mode, select a positive integer interval in seconds, for example 600 means 10 minutes; omit it in once mode.
extend.upgradeCfg.eventStorm.cycleTimes integer Required in cycle mode: the maximum number of triggers, including the first one. Valid range is 1 to 30; recorded counts do not equal successful deliveries.
Example: 3
How to obtain or fill in: In cycle mode, enter an integer from 1 to 30; omit it in once mode.
name string Y Required non-empty policy name, maximum 256 characters; it must also be submitted on update.
Allow null: False
Maximum length: 256
Allow empty string: False
Example: Production Issue Notification
How to obtain or fill in: Check existing policy names in Notification Policy List and choose a name that is not already used in the current workspace.
notificationScheduleUUIDs array Optional in the runtime declaration, but clients should explicitly submit the array when creating; pass [] when there are no schedules. Omitting it may return 500 after the body has been saved.
Allow null: False
Example: ["nsche_example"]
How to obtain or fill in: Obtain notification schedules in the same workspace from content.data[].uuid in Notification Schedule List; one policy can be associated with multiple schedules.
extend json Optional notification configuration; when omitted, {} is saved and no notification actions are enabled.
Allow null: False
Example: {"notifyTypes": ["issue.add", "issue.modify", "issueReply.add", "issueUpgrade.noManager", "issueUpgrade.processTimeout", "issueUpgrade.eventStorm"], "upgradeCfg": {"noManager": {"duration": 600, "notifyType": "once"}, "processTimeout": {"duration": 1800, "notifyType": "cycle", "cycleDuration": 600, "cycleTimes": 3}, "openProcessTimeout": {"duration": 900, "notifyType": "once"}, "eventStorm": {"exceedTimes": 60, "notifyType": "once"}}}
How to obtain or fill in: Fill in according to the Issue actions and escalation rules you need to receive notifications for; pass {} if there is nothing to configure.
extend.notifyTypes array Array of notification trigger types: issue.add = notification on Issue creation; issue.modify = notification on Issue update; issueReply.add = notification on reply creation; issueReply.modify = notification on reply update; issueReply.delete = notification on reply deletion; issueUpgrade.noManager = escalation notification for Issues without an assignee; issueUpgrade.processTimeout = processing timeout escalation, controlling both processTimeout and openProcessTimeout; issueUpgrade.eventStorm = event storm notification after the number of associated events strictly exceeds the threshold; dailySummary = daily summary sent by the site summary task.
Allow null: False
Example: ["issue.add", "issue.modify", "issueReply.add", "issueUpgrade.noManager", "issueUpgrade.processTimeout", "issueUpgrade.eventStorm"]
How to obtain or fill in: Choose from the event types actually supported below and include the corresponding string for each type you need; omitting this field or passing [] disables these actions.
extend.upgradeCfg json Object holding four escalation rule types, each configurable separately; when there are no escalation rules, omit it or pass {}.
Allow null: False
Example: {"noManager": {"duration": 600, "notifyType": "once"}, "processTimeout": {"duration": 1800, "notifyType": "cycle", "cycleDuration": 600, "cycleTimes": 3}, "openProcessTimeout": {"duration": 900, "notifyType": "once"}, "eventStorm": {"exceedTimes": 60, "notifyType": "once"}}
How to obtain or fill in: First enable the corresponding escalation type in notifyTypes, then fill in its rules; providing rules without enabling the type does not create a valid escalation trigger.

Additional Parameter Notes

noManager is the no-assignee wait, processTimeout is the continuous processing timeout in Open/Working, and openProcessTimeout is the Open-only timeout; the latter two are both enabled by issueUpgrade.processTimeout. eventStorm uses an associated event count threshold rather than a wait in seconds. Cycle rules must provide both cycleDuration and cycleTimes; a missing field may save the configuration without creating a rule that takes effect. Nested fields are not strictly validated item by item, so incorrect types may also return a generic internal error.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/issue/notification_policy/add' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"name":"Production Issue Notification","notificationScheduleUUIDs":["nsche_example"],"extend":{"notifyTypes":["issue.add","issue.modify","issueReply.add","issueUpgrade.noManager","issueUpgrade.processTimeout","issueUpgrade.eventStorm"],"upgradeCfg":{"noManager":{"duration":600,"notifyType":"once"},"processTimeout":{"duration":1800,"notifyType":"cycle","cycleDuration":600,"cycleTimes":3},"openProcessTimeout":{"duration":900,"notifyType":"once"},"eventStorm":{"exceedTimes":60,"notifyType":"once"}}}}'

Response

HTTP 200, application/json. The example below shows the main fields that can be read directly.

Field Type Description
content.id integer or null Policy record ID; it may be null in a create response constructed before saving; operations use uuid.
content.uuid string Notification policy UUID, prefixed with inpy_.
content.workspaceUUID string UUID of the workspace the policy belongs to.
content.name string Policy name.
content.status integer Record status: 0 enabled, 2 disabled, 3 deleted; lists include enabled and disabled policies that are not deleted.
content.creator string Identity that performed the create call.
content.updator string Identity of the most recent update; an empty string if never updated.
content.createAt integer Creation time, Unix seconds.
content.updateAt integer Update time, Unix seconds; -1 if never updated.
content.deleteAt integer Deletion time, Unix seconds; -1 if not deleted.
content.extend object Saved notification scope and escalation rules; may be {}.
content.extend.notifyTypes array<string> Enabled action types.
content.extend.notifyTypes[] string A single action type; see the parameter table for its specific effect.
content.extend.upgradeCfg object Rules saved by trigger type.
content.extend.upgradeCfg.noManager object When an Issue has no valid assignee at creation and enters the no-assignee candidate set while its status is Open/Working/Pending, the wait starts from Issue creation; for existing Issues, merely removing the assignee does not guarantee re-entry into the candidate set. Enter a positive integer number of seconds that is a multiple of 60. The enabling type is issueUpgrade.noManager; omitted when not configured.
content.extend.upgradeCfg.noManager.duration integer First wait in seconds.
content.extend.upgradeCfg.noManager.notifyType string once or cycle; treated as once when this value is not saved.
content.extend.upgradeCfg.noManager.cycleDuration integer Cycle interval in seconds, used in cycle mode.
content.extend.upgradeCfg.noManager.cycleTimes integer Upper limit of total cycle triggers, 1 to 30, including the first one.
content.extend.upgradeCfg.processTimeout object The continuous unfinished time while an Issue is in Open/Working. The first timer starts from creation; when the Issue re-enters a processing status from Pending/Resolved/Closed, timing starts from the status record after re-entry. The enabling type is issueUpgrade.processTimeout; omitted when not configured.
content.extend.upgradeCfg.processTimeout.duration integer First wait in seconds.
content.extend.upgradeCfg.processTimeout.notifyType string once or cycle; treated as once when this value is not saved.
content.extend.upgradeCfg.processTimeout.cycleDuration integer Cycle interval in seconds, used in cycle mode.
content.extend.upgradeCfg.processTimeout.cycleTimes integer Upper limit of total cycle triggers, 1 to 30, including the first one.
content.extend.upgradeCfg.openProcessTimeout object Takes effect only while the Issue remains Open, timed from the last status change; if there is no status record, timed from creation. The enabling type is issueUpgrade.processTimeout; omitted when not configured.
content.extend.upgradeCfg.openProcessTimeout.duration integer First wait in seconds.
content.extend.upgradeCfg.openProcessTimeout.notifyType string once or cycle; treated as once when this value is not saved.
content.extend.upgradeCfg.openProcessTimeout.cycleDuration integer Cycle interval in seconds, used in cycle mode.
content.extend.upgradeCfg.openProcessTimeout.cycleTimes integer Upper limit of total cycle triggers, 1 to 30, including the first one.
content.extend.upgradeCfg.eventStorm object Triggers after the Issue record's eventCount is strictly greater than exceedTimes; it is not limited by Open/Working status, so completed Issues may also satisfy the count condition. The enabling type is issueUpgrade.eventStorm; omitted when not configured.
content.extend.upgradeCfg.eventStorm.exceedTimes integer Count threshold; triggers only when eventCount strictly exceeds it.
content.extend.upgradeCfg.eventStorm.notifyType string once or cycle; treated as once when this value is not saved.
content.extend.upgradeCfg.eventStorm.cycleDuration integer Cycle interval in seconds, used in cycle mode.
content.extend.upgradeCfg.eventStorm.cycleTimes integer Upper limit of total cycle triggers, 1 to 30, including the first one.
content.extend.other fields JSON Other extension fields saved from the source; not all of them control notification behavior.
content.notificationScheduleUUIDs array<string> Array of associated schedule UUIDs on success; [] when there are no associations. Omitting the field on creation may return 500, which should not be treated as a successful null structure.
content.notificationScheduleUUIDs[] string Schedule UUID.
content.declaration object or null Workspace public declaration.
{
  "code": 200,
  "content": {
    "id": null,
    "uuid": "inpy_example",
    "workspaceUUID": "wksp_example",
    "name": "Production Issue Notification",
    "extend": {
      "notifyTypes": [
        "issue.add",
        "issue.modify",
        "issueReply.add",
        "issueUpgrade.noManager",
        "issueUpgrade.processTimeout",
        "issueUpgrade.eventStorm"
      ],
      "upgradeCfg": {
        "noManager": {
          "duration": 600,
          "notifyType": "once"
        },
        "processTimeout": {
          "duration": 1800,
          "notifyType": "cycle",
          "cycleDuration": 600,
          "cycleTimes": 3
        },
        "openProcessTimeout": {
          "duration": 900,
          "notifyType": "once"
        },
        "eventStorm": {
          "exceedTimes": 60,
          "notifyType": "once"
        }
      }
    },
    "status": 0,
    "creator": "wsak_example",
    "updator": "",
    "createAt": 1785430800,
    "updateAt": -1,
    "deleteAt": -1,
    "notificationScheduleUUIDs": [
      "nsche_example"
    ],
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Response

For authentication, rate limiting, and common request errors, see Common Error Definitions.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
406 ft.ParameterValidationFailed A request field is missing, or a field value violates the declared validation conditions Parameter parsing failed Verify the parameter location, field name, type, and value.
400 ft.RequestJsonFormatError The request JSON syntax is invalid Request JSON format error Fix the JSON according to content.reason, line, and column.
400 ft.JsonFormatError The JSON top level is not an object Partial json file format error Submit a single JSON object.
400 ft.PolicySameNameExists A policy with the same name that is not deleted exists in the current workspace, including disabled policies A notification policy with the same name already exists Choose a name that is not in use; after a timeout, first confirm whether it has already been saved.
400 ft.InvalidFieldValue notifyType is not once/cycle, or cycleTimes is not within 1 to 30 Field {} value: {} is invalid Fill in notifyType and the count according to the rules; for nested objects, use the correct types.
400 ft.UpgradeTimeTooLarge Any time-based duration is greater than 31622400 seconds Escalation time configuration is too large; set a reasonable escalation trigger time Shorten the wait time; the maximum is 31622400 seconds.
400 ft.InvalidUpgradeTimeDuration A time-based duration is not an integer multiple of 60 seconds Escalation time configuration must be a positive integer multiple of 60(s) Use the number of seconds obtained by multiplying a positive integer number of minutes by 60.
400 ft.exceedTimesTooLarge eventStorm.exceedTimes is greater than 31622400 The associated event trigger count is too large; set a reasonable trigger count Use a positive integer event count threshold no greater than 31622400.
500 ft.InternalServerError notificationScheduleUUIDs is omitted, or an internal failure occurs in relationship saving, escalation rule processing, etc.; the policy body may already be saved Internal error First check the policy list to see whether a record with the same name has been created; explicitly provide the notificationScheduleUUIDs array in the create request, then decide whether to retry.

Feedback

Is this page helpful?