Skip to content

Add closed_as_duplicate_of to issues Graphql type

What does this MR do and why?

This adds closed_as_duplicate_of as a new field on the Issue GraphQL type.

closed_as_duplicate_of exposes the Issue Y (if any) that the current Issue X was closed as a duplicate of.

GraphQL Request
{
  project(fullPath: "flightjs/Flight"){
    issue(iid: "93") {
      id
      iid
      title
      closedAsDuplicateOf {
        id
        title
      }
    }
  }
}
GraphQL Response
{
  "data": {
    "project": {
      "issue": {
        "id": "gid://gitlab/Issue/615",
        "iid": "93",
        "title": "Escalation policy test",
        "closedAsDuplicateOf": {
          "id": "gid://gitlab/Issue/614",
          "title": "Testing slash command"
        }
      }
    }
  }
}

As this uses the existing IssueType, any existing permission checks are carried out. An issue that the requesting user does not have permission to view will not be shown in the response.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

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

Related to #352261 (closed)

Edited by Sean Arnold

Merge request reports