Notification rules allow users to configure notification steps that use their existing contact methods and define conditions & time constraints on them. This resource represents the contract to create/get/update/delete/list of notification-rules in Jira Service Management.
Lists all notification rules for the user. It optionally takes two parameters - offset and size.
read:ops-config:jira-service-managementinteger
integer
Returned if the request is successful.
1
2
3
4
curl --request GET \
--url 'https://api.atlassian.com/jsm/ops/api/{cloudId}/v1/notification-rules' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
"values": [
{
"id": "4292c912-12ac-4ac0-b195-9484fbb98c5c",
"name": "Create Alert",
"actionType": "create-alert",
"criteria": {
"type": "match-all"
},
"timeRestriction": {
"type": "weekday-and-time-of-day",
"restrictions": [
{
"startDay": "monday",
"endDay": "friday",
"startHour": 13,
"endHour": 18,
"startMin": 0,
"endMin": 0
}
]
},
"order": 1,
"steps": [
{
"id": "0hcb717e-c442-4185-8bc1-cc998844f567",
"sendAfter": 0,
"contact": {
"method": "email",
"to": "test@atlassian.com"
},
"enabled": true
}
],
"repeat": {
"loopAfter": 1,
"enabled": true
},
"enabled": true
}
],
"links": {
"next": "/v1/notification-rules?offset=10&size=5"
}
}Creates a notification rule with the given properties for the user. To create it with an advanced condition, set criteria.type to advanced-query and send query instead of conditions.
read:ops-config:jira-service-managementwrite:ops-config:jira-service-managementstring
Requiredstring
RequiredoneOf [NotificationRulesMatchAllAnyConditionsFilter, NotificationRulesMatchAllFilter, AdvancedQueryFilter]
array<string>
oneOf [NotificationRulesTimeOfDayTimeRestrictionInterval, NotificationRulesWeekdayTimeRestrictionInterval]
array<string>
integer
array<NotificationRulesCreateNotificationRuleStepRequest>
NotificationRuleRepeat
boolean
RequiredReturned if the request is successful.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
curl --request POST \
--url 'https://api.atlassian.com/jsm/ops/api/{cloudId}/v1/notification-rules' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"name": "Critical alerts",
"actionType": "create-alert",
"criteria": {
"type": "match-any-condition",
"conditions": [
{
"field": "message",
"operation": "contains",
"expectedValue": "critical"
}
]
},
"enabled": true
}'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
"id": "4292c912-12ac-4ac0-b195-9484fbb98c5c",
"name": "Create Alert",
"actionType": "create-alert",
"criteria": {
"type": "match-all"
},
"timeRestriction": {
"type": "weekday-and-time-of-day",
"restrictions": [
{
"startDay": "monday",
"endDay": "friday",
"startHour": 13,
"endHour": 18,
"startMin": 0,
"endMin": 0
}
]
},
"order": 1,
"steps": [
{
"id": "0hcb717e-c442-4185-8bc1-cc998844f567",
"sendAfter": 0,
"contact": {
"method": "email",
"to": "test@atlassian.com"
},
"enabled": true
}
],
"repeat": {
"loopAfter": 1,
"enabled": true
},
"enabled": true
}Gets a notification rule with given id in the request. For an advanced condition criteria carries type advanced-query, query and the read-only conditionTree, and has no conditions.
read:ops-config:jira-service-managementstring
RequiredReturned if the request is successful.
1
2
3
4
curl --request GET \
--url 'https://api.atlassian.com/jsm/ops/api/{cloudId}/v1/notification-rules/{id}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
"id": "8418d193-2dab-4490-b331-8c02cdd196b7",
"name": "Critical alerts",
"actionType": "create-alert",
"criteria": {
"type": "advanced-query",
"query": "priority:P1 AND (tags:prod OR tags:canary)",
"conditionTree": {
"operator": "AND",
"not": false,
"children": [
{
"field": "priority",
"operation": 5,
"expectedValue": "P1",
"not": false,
"fieldFreeForm": false
},
{
"operator": "OR",
"not": false,
"children": [
{
"field": "tags",
"operation": 1,
"expectedValue": "prod",
"not": false,
"fieldFreeForm": false
},
{
"field": "tags",
"operation": 1,
"expectedValue": "canary",
"not": false,
"fieldFreeForm": false
}
]
}
]
}
},
"enabled": true
}Deletes a notification rule with given id in the request.
read:ops-config:jira-service-managementdelete:ops-config:jira-service-managementstring
RequiredReturned if the request is successful.
1
2
3
curl --request DELETE \
--url 'https://api.atlassian.com/jsm/ops/api/{cloudId}/v1/notification-rules/{id}' \
--user 'email@example.com:<api_token>'Updates a notification rule with given id in the request. Omitting criteria keeps the current condition, advanced or basic, unchanged. Sending a basic criteria replaces an advanced condition and clears its query. Sending type advanced-query without a query answers 400.
read:ops-config:jira-service-managementwrite:ops-config:jira-service-managementstring
Requiredstring
Requiredstring
RequiredoneOf [NotificationRulesMatchAllAnyConditionsFilter, NotificationRulesMatchAllFilter, AdvancedQueryFilter]
array<string>
oneOf [NotificationRulesTimeOfDayTimeRestrictionInterval, NotificationRulesWeekdayTimeRestrictionInterval]
array<string>
integer
array<NotificationRulesCreateNotificationRuleStepRequest>
NotificationRuleRepeat
boolean
RequiredReturned if the request is successful.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
curl --request PATCH \
--url 'https://api.atlassian.com/jsm/ops/api/{cloudId}/v1/notification-rules/{id}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"name": "Create Alert",
"actionType": "create-alert",
"criteria": {
"type": "match-all"
},
"steps": [
{
"id": "0hcb717e-c442-4185-8bc1-cc998844f567",
"sendAfter": 0,
"contact": {
"method": "email",
"to": "test@atlassian.com"
},
"enabled": true
}
],
"enabled": true
}'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
"id": "4292c912-12ac-4ac0-b195-9484fbb98c5c",
"name": "Create Alert",
"actionType": "create-alert",
"criteria": {
"type": "match-all"
},
"timeRestriction": {
"type": "weekday-and-time-of-day",
"restrictions": [
{
"startDay": "monday",
"endDay": "friday",
"startHour": 13,
"endHour": 18,
"startMin": 0,
"endMin": 0
}
]
},
"order": 1,
"steps": [
{
"id": "0hcb717e-c442-4185-8bc1-cc998844f567",
"sendAfter": 0,
"contact": {
"method": "email",
"to": "test@atlassian.com"
},
"enabled": true
}
],
"repeat": {
"loopAfter": 1,
"enabled": true
},
"enabled": true
}Rate this page: