Skip to content

Create issue which is already associated with the alert

Sarah Yasonik requested to merge sy-fix-alert-incident-creation into master

What does this MR do and why?

Related issue: #330284 (closed)

Associates alerts with incident issues on creation, rather than as a post-creation task. This allows the behavior in IssuableEscalationEtatuses/CreateService to be utilized from Issues::CreateService.

This is not user-facing.

How to set up and check for regressions locally

  1. Open a project with an escalation policy in EE (Monitor > Escalation policies to create a policy)
  2. Navigate to Settings > Monitor > Alerts > Current integrations
  3. Create & enable a new HTTP Endpoint alert integration if none exist
  4. For an existing integration, click Screen_Shot_2022-02-03_at_6.49.45_PM > Send test alert to trigger a test with a sample payload, like this one:
    • {"title":"Triggering a test alert to associate with an incident"}
  5. Navigate to Monitor > Alerts to find & open the detail view of the new of alert
  6. Click Create incident & see that the incident got created
  7. In rails console, check that the alert is associated with the incident & the escalation policy
    issue = Issue.last!
    issue.alert_management_alert #=> should be present
    issue.escalation_status.policy #=> should be present   

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