Skip to content

Add system note for when paging starts on a manually created incident

What does this MR do and why?

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.

Screen_Shot_2021-12-17_at_5.42.54_PM

How to set up and validate locally

  1. Enable the feature flag via rails console

    Feature.enable(:incident_escalations)
  2. Create an incident (Issue w/ issue_type of :incident, without an alert)

  3. Setup an escalation policy in the project

  4. 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
  5. 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

  6. 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

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Sarah Yasonik

Merge request reports

Loading