Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/issuable_base_service.rb')
-rw-r--r--app/services/issuable_base_service.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/services/issuable_base_service.rb b/app/services/issuable_base_service.rb
index 1d1d9b6bec7..ecf10cf97a8 100644
--- a/app/services/issuable_base_service.rb
+++ b/app/services/issuable_base_service.rb
@@ -63,6 +63,7 @@ class IssuableBaseService < ::BaseProjectService
filter_milestone
filter_labels
filter_severity(issuable)
+ filter_escalation_status(issuable)
end
def filter_assignees(issuable)
@@ -152,6 +153,18 @@ class IssuableBaseService < ::BaseProjectService
params[:issuable_severity_attributes] = { severity: severity }
end
+ def filter_escalation_status(issuable)
+ result = ::IncidentManagement::IssuableEscalationStatuses::PrepareUpdateService.new(
+ issuable,
+ current_user,
+ params.delete(:escalation_status)
+ ).execute
+
+ return unless result.success? && result.payload.present?
+
+ params[:incident_management_issuable_escalation_status_attributes] = result[:escalation_status]
+ end
+
def process_label_ids(attributes, existing_label_ids: nil, extra_label_ids: [])
label_ids = attributes.delete(:label_ids)
add_label_ids = attributes.delete(:add_label_ids)
@@ -471,6 +484,7 @@ class IssuableBaseService < ::BaseProjectService
associations[:description] = issuable.description
associations[:reviewers] = issuable.reviewers.to_a if issuable.allows_reviewers?
associations[:severity] = issuable.severity if issuable.supports_severity?
+ associations[:escalation_status] = issuable.escalation_status&.slice(:status, :policy_id) if issuable.supports_escalation?
associations
end