Skip to content

Add escalation status field and mutation for incidents

Sarah Yasonik requested to merge sy-expose-paging-status into master

What does this MR do and why?

Exposes a field for the escalation/paging status of incidents in GraphQL. This is intended to be used from the incident list & incident detail view.

!76987 (merged) merged before this one, but some of the feedback during review could be applied to both. So this MR includes some bonus changes to keep these fields consistent with each other.

Sample inputs/outputs

Fetch
query issues {
  project(fullPath: "root/autodevops") {
    issues(types: INCIDENT) {
      nodes {
        iid
        title
        type
        escalationStatus
      }
    }
  }
}
{
  "data": {
    "project": {
      "issues": {
        "nodes": [
          {
            "iid": "194",
            "title": "trying again on new alert  - queue another",
            "type": "INCIDENT",
            "escalationStatus": "TRIGGERED"
          },
          {
            "iid": "193",
            "title": "trying again on new alert  - queue another",
            "type": "INCIDENT",
            "escalationStatus": null
          },
          {
            "iid": "192",
            "title": "trying again on new alert  - queue another",
            "type": "INCIDENT",
            "escalationStatus": "IGNORED"
          }
        ]
      }
    }
  }
}
Update
mutation SetEscalationStatus($update: IssueSetEscalationStatusInput!) {
  issueSetEscalationStatus(input: $update) {
    issue {
      iid
      title
      type
      escalationStatus
    }
  }
}

Setting the status

{
  "update": {
    "projectPath": "root/autodevops",
    "iid": "194",
    "status": "ACKNOWLEDGED"
  }
}
{
  "data": {
    "issueSetEscalationStatus": {
      "issue": {
        "iid": "194",
        "title": "trying again on new alert  - queue another",
        "type": "INCIDENT",
        "escalationStatus": "ACKNOWLEDGED"
      }
    }
  }
}

How to set up and validate locally

  1. Follow the steps in !76819 (merged) add an IncidentManagement::IssuableEscalationStatus association to your incident
  2. Open /-/graphql-explorer in your local env to run graphql queries/mutations like the samples above

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