2021-01-03 14:25:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module IncidentManagement
|
|
|
|
class AddSeveritySystemNoteWorker # rubocop:disable Scalability/IdempotentWorker
|
|
|
|
include ApplicationWorker
|
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
sidekiq_options retry: 3
|
|
|
|
|
2021-01-03 14:25:43 +05:30
|
|
|
queue_namespace :incident_management
|
|
|
|
feature_category :incident_management
|
2021-06-08 01:23:25 +05:30
|
|
|
tags :exclude_from_kubernetes
|
2021-01-03 14:25:43 +05:30
|
|
|
|
|
|
|
def perform(incident_id, user_id)
|
|
|
|
return if incident_id.blank? || user_id.blank?
|
|
|
|
|
|
|
|
incident = Issue.with_issue_type(:incident).find_by_id(incident_id)
|
|
|
|
return unless incident
|
|
|
|
|
|
|
|
user = User.find_by_id(user_id)
|
|
|
|
return unless user
|
|
|
|
|
|
|
|
SystemNoteService.change_incident_severity(incident, user)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|