diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-21 21:12:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-21 21:12:45 +0300 |
commit | 6be1f63eb6ca987f959c18576bb9042b9ee7726b (patch) | |
tree | cb15e23f3087776b54c4190d9aec4aa0c507ffb5 /app/services/alert_management | |
parent | 48fc1ad8991a96ef2eaa927bb6df3bfab2c78e46 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/alert_management')
-rw-r--r-- | app/services/alert_management/alerts/update_service.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/services/alert_management/alerts/update_service.rb b/app/services/alert_management/alerts/update_service.rb index 7a9bcf2a52d..6bac1d027e6 100644 --- a/app/services/alert_management/alerts/update_service.rb +++ b/app/services/alert_management/alerts/update_service.rb @@ -12,6 +12,7 @@ module AlertManagement @alert = alert @param_errors = [] @status = params.delete(:status) + @status_change_reason = params.delete(:status_change_reason) super(project: alert.project, current_user: current_user, params: params) end @@ -36,7 +37,7 @@ module AlertManagement private - attr_reader :alert, :param_errors, :status + attr_reader :alert, :param_errors, :status, :status_change_reason def allowed? current_user&.can?(:update_alert_management_alert, alert) @@ -133,7 +134,7 @@ module AlertManagement end def add_status_change_system_note - SystemNoteService.change_alert_status(alert, current_user) + SystemNoteService.change_alert_status(alert, current_user, status_change_reason) end def resolve_todos @@ -144,7 +145,12 @@ module AlertManagement ::Issues::UpdateService.new( project: project, current_user: current_user, - params: { escalation_status: { status: status } } + params: { + escalation_status: { + status: status, + status_change_reason: " by changing the status of #{alert.to_reference(project)}" + } + } ).execute(alert.issue) end |