Fix work item change type and child milestone with features field

What does this MR do and why?

Fixes the work item "Change type" modal and child item creation when work_item_features_field is enabled, which is the default since %19.5.

Both read widget data from widgets[], which only carries each widget's type when the flag is on, so they silently saw no data. With the flag off, both already work:

  • Change type never warned that fields like status, dates or weight would be lost, and couldn't see the work item's milestone or child types. The modal now also receives features and reads from it first.
  • New child items created from the "Child items" widget no longer inherited the parent's milestone. The detail page now reads the milestone through findMilestoneWidget.

The modal keeps its existing "has data" check, so it now behaves the same as with the flag off. Custom fields also get a name in the warning, so the list no longer shows an empty item.

Known gaps for reviewers

These exist with the flag off too, so this MR keeps them as they are:

  • The check reads only the first field of each widget. Custom fields warn when the work item type has custom fields, even if none are set. Contacts warn when the group has contacts, even if the work item has none.
  • Linked items with only "relates to" links, time tracking, and development never warn, because the detail query doesn't load their data.

References

Screenshots or screen recordings

The flag-off recordings are for comparison. With the flag off, the only change is that Custom fields now has a name in the warning instead of an empty item.

Change type (an issue that has a due date and a status, converted to Incident)

Flag off Flag on
Before
After

New child item from Child items (an issue that has a milestone)

Flag off Flag on
Before
After

How to set up and validate locally

  1. Open an issue that has a due date and a status, then select More actions > Change type and pick Incident.
  2. Verify the warning lists Dates and Status.
  3. Open an issue that has a milestone, and in Child items select Add > New task, then create a task.
  4. Verify the new task shows the parent's milestone.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

🤖 Generated with Claude Code

Edited by Kushal Pandya

Merge request reports

Loading
Loading