Skip to content

Show ancestors when the work item parent is unassigned and reassigned again

What does this MR do and why?

When a parent is reassigned after unassigning an existing parent, the ancestor widget data becomes blank. The possible root cause to it is receiving null in response of workItemUpdate subscription. Currently, we have not found root cause why the workItemUpdated data is coming as null as per the thread. But we have found a workaround to update the ancestor data whenever the parent is updated on frontend side.

This MR enables parent widget to use updateWorkItem mutation with ancestor fragment in response. Due to this, not only the parent is updated but also ancestors get updated.

MR acceptance checklist

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

Screenshots or screen recordings

Before After
Screen Recording 2024-09-20 at 5.04.43 PM.mov Screen Recording 2024-09-20 at 4.51.39 PM.mov

How to set up and validate locally

Prerequisites:

  1. Enable the OKRs feature as mentioned in the OKRs docs (e.g. ::Feature.enabled?(:okrs_mvc, Project.find(<PROJECT_ID>)) and the namespace must have Ultimate plan).
  2. Enable Epic work items
    1. Feature.enable(:work_item_epics_rollout)
    2. Feature.enable(:work_item_epics)

Steps to verify at Group level:

  1. Login with any user
  2. Go to Group > Epics
  3. Open or create an Epic
  4. Set a parent to the Epic
  5. Clear the parent and verify the ancestor widget is updated
  6. Reassign a parent and verify the ancestor widget is updated

Steps to verify at Project level:

  1. Login with any user
  2. Go to Project > Issues
  3. Open or create an Objective
  4. Create a child item or add an existing child item
  5. Set a parent to the Objective
  6. Clear the parent and verify the ancestor widget is updated
  7. Reassign a parent and verify the ancestor widget is updated

Related to #474861 (closed)

Edited by Rajan Mistry

Merge request reports

Loading