Skip to content
Snippets Groups Projects

Create work item with iteration

Merged euko requested to merge 367456-update-create-work-item-mutation into master

What does this MR do and why?

This MR adds the ability to assign an iteration to a work item on creation via GraphQL mutation workItemCreate.

The change allows us to reduce the complexity on the frontend because we can avoid chaining mutations workItemCreate and workItemUpdate (#367456 (comment 1098107478).)

How to set up and validate locally

  • Prepare an iteration. Visit any group and navigate to Issues -> Iterations in the left sidebar.
    • Create a new iterations cadence by clicking New iteration cadence.
      • For simplicity, uncheck Enable automatic scheduling
    • To the created iterations cadence, add an iteration.
    • Grab the id of the created iteration by running gdk psql -c "SELECT id FROM sprints ORDER BY id DESC LIMIT 1;" in your terminal.
video walkthrough

demo

Sample query

mutation myMutation {
  workItemCreate(input: {
    projectPath: "gitlab-org/gitlab-test"
    workItemTypeId: "gid://gitlab/WorkItems::Type/1" # corresponds to Issue type
    title: "some work item"
    iterationWidget: {
      iterationId: "gid://gitlab/Iteration/4" # you might try out `null` and other values.
    }
  }) {
    errors
    workItem {
      id
      title
      widgets {
        type
        ... on WorkItemWidgetIteration {
          iteration {
            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 #367456 (closed)

Edited by euko

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • John Mason
  • John Mason removed review request for @john-mason

    removed review request for @john-mason

  • euko added 1199 commits

    added 1199 commits

    Compare with previous version

  • Ghost User
  • Ghost User
  • euko added 1 commit

    added 1 commit

    Compare with previous version

  • euko
  • euko added 1 commit

    added 1 commit

    • 33cb27ea - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • euko added 2 commits

    added 2 commits

    Compare with previous version

  • euko requested review from @john-mason

    requested review from @john-mason

  • euko added 483 commits

    added 483 commits

    Compare with previous version

    • Resolved by euko

      Hey @euko :wave: Thank you for working this :pray: Just wanted to confirm that after this merge , the workItemUpdate with iteration with an iteration will still work like associating it for the first time , right ? :thinking:

      I am thinking in terms of backward compatibility and that should I be doing any frontend changes in the same MR not to break the iteration feature.

      Thank you !

  • John Mason approved this merge request

    approved this merge request

  • John Mason requested review from @seanarnold and removed review request for @john-mason

    requested review from @seanarnold and removed review request for @john-mason

  • :wave: @john-mason, thanks for approving this merge request.

    This is the first time the merge request is approved. To ensure full test coverage, a new pipeline will be started shortly.

    For more info, please refer to the following links:

  • 🤖 GitLab Bot 🤖 added 1 deleted label

    added 1 deleted label

  • Sean Arnold requested review from @terrichu and removed review request for @seanarnold

    requested review from @terrichu and removed review request for @seanarnold

  • Terri Chu
  • Terri Chu
  • Terri Chu
  • Terri Chu removed review request for @terrichu

    removed review request for @terrichu

  • euko added 594 commits

    added 594 commits

    Compare with previous version

  • euko added 1 commit

    added 1 commit

    • 6fc686c2 - Apply backend maintainer suggestions

    Compare with previous version

  • euko requested review from @msedlakjakubowski

    requested review from @msedlakjakubowski

  • euko requested review from @terrichu

    requested review from @terrichu

  • Terri Chu changed milestone to %15.7

    changed milestone to %15.7

  • Terri Chu approved this merge request

    approved this merge request

  • Terri Chu resolved all threads

    resolved all threads

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading