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/system_notes/incident_service.rb')
-rw-r--r--app/services/system_notes/incident_service.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/app/services/system_notes/incident_service.rb b/app/services/system_notes/incident_service.rb
index 785291e0637..f3f9dfbec96 100644
--- a/app/services/system_notes/incident_service.rb
+++ b/app/services/system_notes/incident_service.rb
@@ -26,8 +26,19 @@ module SystemNotes
end
end
- def resolve_incident_status
- body = 'changed the status to **Resolved** by closing the incident'
+ # Called when the status of an IncidentManagement::IssuableEscalationStatus has changed
+ #
+ # reason - String.
+ #
+ # Example Note text:
+ #
+ # "changed the incident status to Acknowledged"
+ # "changed the incident status to Acknowledged by changing the status of ^alert#540"
+ #
+ # Returns the created Note object
+ def change_incident_status(reason)
+ status = noteable.escalation_status.status_name.to_s.titleize
+ body = "changed the incident status to **#{status}**#{reason}"
create_note(NoteSummary.new(noteable, project, author, body, action: 'status'))
end