Skip to content

Commit

Permalink
fix reassigning to an escalation policy
Browse files Browse the repository at this point in the history
an indent bug meant triggered events would only be reassigned to
users... escalation policies would silently fail after creating the
initial incident.
  • Loading branch information
bobzoller committed Jun 7, 2019
1 parent 50e3ba4 commit 16d172d
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/scripts/pagerduty.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,15 @@ module.exports = (robot) ->
}
}


pagerduty.put "/incidents", data , (err, json) ->
if err?
robot.emit 'error', err, msg
return

if json?.incidents.length == 1
msg.reply ":pager: assigned to #{results.name}!"
else
msg.reply "Problem reassigning the incident :/"
pagerduty.put "/incidents", data , (err, json) ->
if err?
robot.emit 'error', err, msg
return

if json?.incidents.length == 1
msg.reply ":pager: assigned to #{results.name}!"
else
msg.reply "Problem reassigning the incident :/"
, 10000

robot.respond /(?:pager|major)(?: me)? ack(?:nowledge)? (.+)$/i, (msg) ->
Expand Down

0 comments on commit 16d172d

Please sign in to comment.