forked from keephq/keep
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_service_now_ticket_upon_alerts.yml
More file actions
33 lines (33 loc) · 1.26 KB
/
Copy pathcreate_service_now_ticket_upon_alerts.yml
File metadata and controls
33 lines (33 loc) · 1.26 KB
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
workflow:
id: servicenow
description: create a ticket in servicenow when an alert is triggered
triggers:
- type: alert
# create ticket for grafana/prometheus alerts
filters:
- key: source
value: r"(grafana|prometheus)"
actions:
- name: create-service-now-ticket
# if the ticket id is not present in the alert, create a ticket
if: "not '{{ alert.ticket_id }}' and {{ alert.annotations.ticket_type }}"
provider:
type: servicenow
config: " {{ providers.servicenow }} "
with:
table_name: "{{ alert.annotations.ticket_type }}"
payload:
short_description: "{{ alert.name }} - {{ alert.description }} [created by Keep][fingerprint: {{alert.fingerprint}}]"
description: "{{ alert.description }}"
# enrich the alert with the ticket number and other details returned from servicenow
enrich_alert:
- key: ticket_type
value: servicenow
- key: ticket_id
value: results.sys_id
- key: ticket_url
value: results.link
- key: ticket_status
value: results.stage
- key: table_name
value: "{{ alert.annotations.ticket_type }}"