Skip to content

Allow WIT changes and fix issue types changes

Nicolas Dular requested to merge nd/generic-issue-type-change into master

What does this MR do and why?

Part of the larger Epic &9438 to allow work item type changes. I created this branch out of the POC in !112221 (merged) to have a smaller MR.

This change introduces the ability to change any work item type to any other by validating the hierarchy restrictions.

It also fixes an issue with existing issue type changes when they are part of an epic. Until now it was possible to change the type of an Issue to an Incident, even though the Issue was part of an Epic. This should be prevented as Incidents do not support Epics.

Screenshots or screen recordings

Issue Key result
Screenshot_2023-03-07_at_15.51.52 Screenshot_2023-03-07_at_15.51.25

New error when changing type for issue to an incident:

Screenshot_2023-03-07_at_15.45.36

How to set up and validate locally

Issue <-> Incident

  1. Go to an Issue
  2. Click "Edit" (pencil icon)
  3. Change the Issue type to an Incident -> Still works
  4. If you assign an epic to the Issue, changing produces an error 🔴 (this changed)

Objective <-> Key Result

Note: this is not possible in the UI and not expected to work before we ship !112221 (merged) it's still possible to validate via the console:

  1. Create an Objective
work_item = WorkItem.last
work_item.work_item_type_id = WorkItems::Type.default_by_type(:key_result).id
work_item.save!

puts work_item.iid

# Open the URL:, e.g. http://gdk.test:3000/<PATH_TO_PROJECT>/-/work_items/<IID>?iid_path=true

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 Nicolas Dular

Merge request reports

Loading