Class: Commands::Resolve

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/lita/commands/resolve.rb

Instance Method Summary collapse

Methods included from Base

#current_user, #format_incident, #format_incidents, #format_note, #format_notes, included, #initialize, #pagerduty, #response, #store

Instance Method Details

#callObject



5
6
7
8
9
10
11
12
13
# File 'lib/lita/commands/resolve.rb', line 5

def call
  incident_id = message.match_data['incident_id']
  return if incident_id =~ /\A(all|mine)\z/i

  pagerduty.manage_incidents(:resolve, [incident_id])
  response message: 'all.resolved', params: { list: incident_id.to_s }
rescue Exceptions::IncidentManageUnsuccess
  nil
end