Skip to content

Commit

Permalink
[handler] adds custom payload to sn
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-afedorov committed Aug 10, 2020
1 parent 75eb368 commit bbbb4c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runners/handlers/service_now.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __call__(self, r):
return r


def handle(alert, assignee=''):
def handle(alert, assignee='', payload={}):
host = env.get('SA_SN_API_HOST')
if not host:
log.info('skipping service-now handler, missing host')
Expand Down Expand Up @@ -83,7 +83,7 @@ def handle(alert, assignee=''):
response = requests.post(
api_url,
auth=Bearer(access_token) if access_token else (username, password),
json={
json=payload or {
f'{fp}contact_type': 'Integration',
f'{fp}impact': '2',
f'{fp}urgency': '2',
Expand Down

0 comments on commit bbbb4c2

Please sign in to comment.