Add system note for when paging starts on a manually created incident
What does this MR do and why?
- Related issue: #332055 (closed)
- Epic: &5716
- Dependent on: !76986 (merged)
Creates a system note when an incident starts being escalation according to its escalation policy.
Screenshots or screen recordings
Only the first system note is the one added in this MR. The others are just there for context.
The cursor isn't visible in the screenshot, but I'm hovering the 'Testing' link, so you can see where it goes. The underline is only there on hover.
How to set up and validate locally
-
Enable the feature flag via rails console
Feature.enable(:incident_escalations)
-
Create an incident (Issue w/ issue_type of :incident, without an alert)
-
Setup an escalation policy in the project
-
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 policy = project.incident_management_escalation_policies.first
-
Run
::Issues::UpdateService.new(project: project, current_user: user, params: { escalation_status: { policy: policy } }).execute(incident)
to start escalations & create the system note on the incident -
Run
::Issues::UpdateService.new(project: project, current_user: user, params: { escalation_status: { policy: nil } }).execute(incident)
to stop escalations & let you re-start them again.- The status can also be set in this way
::Issues::UpdateService.new(project: project, current_user: user, params: { escalation_status: { status: :resolved } }).execute(incident)
to start/stop escalations & create the system note
- The status can also be set in this way
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.