2020-07-28 23:09:34 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module IncidentManagement
|
|
|
|
class CreateIncidentLabelService < BaseService
|
|
|
|
LABEL_PROPERTIES = {
|
|
|
|
title: 'incident',
|
|
|
|
color: '#CC0033',
|
|
|
|
description: <<~DESCRIPTION.chomp
|
|
|
|
Denotes a disruption to IT services and \
|
|
|
|
the associated issues require immediate attention
|
|
|
|
DESCRIPTION
|
|
|
|
}.freeze
|
|
|
|
|
|
|
|
def execute
|
|
|
|
label = Labels::FindOrCreateService
|
|
|
|
.new(current_user, project, **LABEL_PROPERTIES)
|
2020-10-24 23:57:45 +05:30
|
|
|
.execute(skip_authorization: true)
|
2020-07-28 23:09:34 +05:30
|
|
|
|
|
|
|
ServiceResponse.success(payload: { label: label })
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|