Skip to content

Convert task list item into work item

Mario Celi requested to merge 346042-convert-task-to-work-item into master

What does this MR do and why?

Adds a new mutation that will convert a task list item in an issue's description into a separate work item that is related to the original issue containing the description. Mutation should:

  1. Create a new work item using the task list item as the title of the new work item.
  2. Mark the new work item as related to the original issue.
  3. Update the original issue's description to add a markdown reference to the newly created work item.

How to set up and validate locally

  1. Run bundle exec rails console
  2. Run Feature.enable(:work_items)
  3. Execute a GraphQL query like
mutation {
  workItemCreateFromTask(
    input: {
      id: "gid://gitlab/WorkItem/1",
      workItemData: {
        lineNumberStart: 1,
        lineNumberEnd: 2,
        title: "New work item title",
        workItemTypeId: "gid://gitlab/WorkItems::Type/1",
        lockVersion: 1
      }
    }
  ) {
    errors
    workItem {
      id
      title
      description
    }
    newWorkItem {
      id
      title
      description
      workItemType {
        name
        id
      }
    }
  }
}

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 #346042 (closed)

Edited by Mario Celi

Merge request reports

Loading