Skip to content

Add ability to sort by escalation status to issues GraphQL query

Sarah Yasonik requested to merge sy-sort-incidents-by-status into master

What does this MR do and why?

Related issue: #332056 (closed)

This adds the ability to sort by escalation status in GraphQL, for usage from the incident list (project > Monitor > Incidents).

The escalation status feature for incidents is still in progress at the moment. I've opted not to include a feature flag check, because it's likely to be enabled very soon. This should correspondingly merge after feature flag removal, though it's not strictly blocking. !80444 (merged) Rollout has it a few lil' snags, so I've opted to add in feature flag checks in this MR. This can now be merged whenever.

How to set up and validate locally

  1. Enable the feature flag
    Feature.enable(:incident_escalations)
  2. Create a new incident, and update the status via rails console
    project = Project.find(<PROJECT_ID>)
    incident = project.issues.last
    ::Issues::UpdateService.new(project: project, current_user: User.first, params: { escalation_status: { status: :acknowledged } }).execute(incident)
  3. Open graphql explorer /-/graphql-explorer & run query
    query issues {
      project(fullPath: "root/my_project") {
        issues(types: INCIDENT, sort: ESCALATION_STATUS_DESC) {
          nodes {
            iid
            title
            type
            escalationStatus
          }
        }
      }
    }

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