Skip to content

Add support for moving issues using listPosition

What does this MR do and why?

Adds the listPosition argument to the IssueMoveList mutation so that we can move an issue to a specific position on the list without having to provide the neighboring issue IDs.

This is going to be used by the frontend for the "Move to start of list" and "Move to end of list" functionality. Later on, a "Move to specific position" is also planned.

Related to #367473 (closed)

How to set up and validate locally

Sample mutation
mutation issueMoveListEE($projectPath: ID!, $iid: String!, $boardId: BoardID!, $fromListId: ID, $toListId: ID, $listPosition: Int, $moveBeforeId: ID, $moveAfterId: ID, $epicId: EpicID) {
  issueMoveList(
    input: {projectPath: $projectPath, iid: $iid, boardId: $boardId, fromListId: $fromListId, toListId: $toListId, listPosition: $listPosition, moveBeforeId: $moveBeforeId, moveAfterId: $moveAfterId, epicId: $epicId}
  ) {
    issue {
      ...Issue
      __typename
    }
    errors
    __typename
  }
}

fragment Issue on Issue {
  ...IssueNode
  id
  weight
  blocked
  blockedByCount
  epic {
    id
    __typename
  }
  iteration {
    id
    title
    iterationCadence {
      id
      title
      __typename
    }
    __typename
  }
  __typename
}

fragment IssueNode on Issue {
  id
  iid
  title
  referencePath: reference(full: true)
  dueDate
  timeEstimate
  totalTimeSpent
  humanTimeEstimate
  humanTotalTimeSpent
  emailsDisabled
  confidential
  hidden
  webUrl
  relativePosition
  type
  severity
  milestone {
    ...MilestoneFragment
    __typename
  }
  assignees {
    nodes {
      ...User
      __typename
    }
    __typename
  }
  labels {
    nodes {
      id
      title
      color
      description
      __typename
    }
    __typename
  }
  __typename
}

fragment MilestoneFragment on Milestone {
  expired
  id
  state
  title
  __typename
}

fragment User on User {
  id
  avatarUrl
  name
  username
  webUrl
  __typename
}

Variables:

{
  "boardId": "gid://gitlab/Board/3",
  "fromListId": 8,
  "iid": "5",
  "listPosition": -1,
  "projectPath": "gitlab-org/gitlab-shell",
  "toListId": 8
}

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 Heinrich Lee Yu

Merge request reports