 
     "#{inc.incident_number}: #{inc.created_on} #{summary} #{assigned_to}\n"
 
-  updateIncidents = (msg, incidentNumbers, status) ->
+  updateIncidents = (msg, incidentNumbers, statusFilter, updatedStatus) ->
     withPagerDutyUsers msg, (users) ->
       requesterId = pagerDutyUserId(msg, users)
       return unless requesterId
 
-      pagerDutyIncidents msg, "triggered,acknowledged", (incidents) ->
+      pagerDutyIncidents msg, statusFilter, (incidents) ->
         foundIncidents = []
         for incident in incidents
-          if incidentNumbers.indexOf("#{incident.incident_number}")
+          # FIXME this isn't working very consistently
+          if incidentNumbers.indexOf(incident.incident_number) > -1
             foundIncidents.push(incident)
 
         if foundIncidents.length == 0
-          msg.reply "Couldn't find incident #{incident_number}"
+          msg.reply "Couldn't find incidents #{incidentNumbers.join(', ')} in #{inspect incidents}"
         else
           # loljson
           data = {

    pagerDutyIntegrationAPI msg, "trigger", description, (json) ->
      msg.reply "#{json.status}, key: #{json.incident_key}"

  robot.respond /(pager|major)( me)? ack(nowledge)? (.+)$/i, (msg) ->
    incidentNumbers = msg.match[4].split(/[ ,]+/).filter (incidentNumber) ->
      !incidentNumber
    updateIncidents(msg, incidentNumbers, 'acknowledged')

  robot.respond /(pager|major)( me)? res(olve)?(d)? (.+)$/i, (msg) ->
    incidentNumbers = msg.match[5].split(/[ ,]+/).filter (incidentNumber) ->
      !incidentNumber
    updateIncidents(msg, incidentNumbers, 'resolved')

  robot.respond /(pager|major)( me)? notes (.+)$/i, (msg) ->
    incidentId = msg.match[3]

  robot.respond /who('s|s| is)? (on call|oncall)/i, (msg) ->
    withCurrentOncall msg, (username) ->
      msg.reply "#{username} is on call"

  parseIncidentNumbers = (match) ->
    match.split(/[ ,]+/).map (incidentNumber) ->
      parseInt(incidentNumber)

  missingEnvironmentForApi = (msg) ->
    missingAnything = false
