Skip to content

Alert Management - Severity should be ingested by Alerts endpoint

The Alert endpoint should set severity when it exists in the Alert payload.

To reproduce

  1. Enable the generic alert endpoint (https://docs.gitlab.com/ee/user/project/integrations/generic_alerts.html)
  2. POST the following data to it: {"title": "Simple Alert", "severity": "high"}
    • for example:
curl --request POST --data '{"title": "Simple Alert", "severity": "high"}' --header "Authorization: Bearer <bearer>" --header "Content-Type: application/json" <url>
  1. View the alert management list.

Expected Behaviour

  1. Severity for the new alert should be 'high'

Actual Behaviour

  1. Severity is CRITICAL

More info:

"severity": "high" was just an example. Perhaps the value should be all caps like "HIGH" or an enum like 4 instead.

See our alert params definition - this is missing severity https://gitlab.com/gitlab-org/gitlab/-/blob/a11d61d1df52df434f006daf509dbda34d85e563/lib/gitlab/alert_management/alert_params.rb#L10

Edited by Tristan Read