2020-06-24 14:09:03 -04:00
|
|
|
# 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-07-22 11:09:28 -04:00
|
|
|
.execute(skip_authorization: true)
|
2020-06-24 14:09:03 -04:00
|
|
|
|
|
|
|
ServiceResponse.success(payload: { label: label })
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|