Add system note when escalation status changes
What does this MR do and why?
- Related issue: #332055 (closed)
- Epic: &5716
- Dependent on: !76986 (merged), !77058 (diffs)
Creates a system note when the escalation status of an incident changes. !77058 (merged) includes behavior to sync the status between an incident and a corresponding alert (if preset). If the incident status is changed as a result of an alert's status being changed, this reason is included in the status (and vice versa).
Context
- New
Issue
s with anissue_type
of:incident
will have one associatedIncidentManagement::IssuableEscalationStatus
. It is accessible viaincident.escalation_status
-
IncidentManagement::IssuableEscalationStatus
records have astatus
field, which is the subject of this system note. From a user perspective, theStatus
field will be directly on the incident. (See #330283 (closed)).
Screenshots or screen recordings
Actions resulting in system note screenshots below:
- Create alert
- Create associated incident
- Acknowledge alert (via UI)
- Resolve incident (via console, per instructions below)
Alert system notes | incident system notes |
---|---|
How to set up and validate locally
-
Enable the feature flag via rails console
Feature.enable(:incident_escalations)
System note for status changes on manually created incident
- Create an incident (Issue w/ issue_type of :incident) via UI
- Access the corresponding records via console
incident = Issue.where(issue_type: 1).last project = incident.project user = project.owner # or whatever user has developer+ permissions on the project
- Run
::Issues::UpdateService.new(project: project, current_user: user, params: { escalation_status: { status: :resolved } }).execute(incident)
to change the status & create the system note on the incident
System note for status changes incident created from alert
- Create an HTTP alert integration for your project
- Create a test alert for your integration
- sample payload:
{"title":"This is a new alert!"}
- sample payload:
- Find your alert under Monitor > Alerts, click to view, and create an issue from the alert
- You can change the status of the alert via UI & see the system notes on both the alert & incident
- To change the incident status, see the previous section 'System note for status changes on manually created incident' for instructions via rails console
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Sarah Yasonik