Class: IncidentManagement::CreateIncidentLabelService

Inherits:
BaseService
  • Object
show all
Defined in:
app/services/incident_management/create_incident_label_service.rb

Constant Summary collapse

LABEL_PROPERTIES =
{
  title: 'incident',
  color: '#CC0033',
  description: <<~DESCRIPTION.chomp
    Denotes a disruption to IT services and \
    the associated issues require immediate attention
  DESCRIPTION
}.freeze

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Methods included from BaseServiceUtility

#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level

Methods included from Gitlab::Allowable

#can?

Constructor Details

This class inherits a constructor from BaseService

Instance Method Details

#executeObject


14
15
16
17
18
19
20
# File 'app/services/incident_management/create_incident_label_service.rb', line 14

def execute
  label = Labels::FindOrCreateService
    .new(current_user, project, **LABEL_PROPERTIES)
    .execute(skip_authorization: true)

  ServiceResponse.success(payload: { label: label })
end