Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Commit

Permalink
[pagerduty] by default, only ack the incidents assigned to you
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLundquist committed Jan 20, 2014
1 parent 1a0af1e commit 328be7b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/scripts/pagerduty.coffee
Expand Up @@ -143,6 +143,9 @@ module.exports = (robot) ->

robot.respond /(pager|major)( me)? ack(nowledge)?$/i, (msg) ->
pagerDutyIncidents msg, 'triggered,acknwowledged', (incidents) ->
email = msg.message.user.pagerdutyEmail || msg.message.user.email_address
incidents = incidentsForEmail(incidents, email)

incidentNumbers = (incident.incident_number for incident in incidents)
if incidentNumbers.length < 1
msg.send "Nothing to acknowledge"
Expand Down Expand Up @@ -428,6 +431,10 @@ module.exports = (robot) ->
else
'(???)'

incidentsForEmail = (incidents, user_email) ->
incidents.filter (incident) ->
getUserForIncident(incident) == user_email

generateIncidentString = (incident, hookType) ->
console.log "hookType is " + hookType
assigned_user = getUserForIncident(incident)
Expand Down

0 comments on commit 328be7b

Please sign in to comment.