Skip to content

Support setting ancestor in work items parent widget

What does this MR do and why?

Parent widget for work items currently gets items only related to the project. This MR adds ability to also get items from ancestor group to be set as Parent of work items.

Currently, we are allowing following parent-child relationship as per &6286

Type Can be parent of Can be child of
Epic Epic Epic
Issue Task Epic
Task None Issue
Objective Objective Objective
Key result None Objective

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

Add parent to any work item as per above table

Type Detail page Drawer
Issue Screen Recording 2024-05-28 at 7.29.12 PM.mov Screen Recording 2024-05-28 at 7.37.17 PM.mov
Epic/Objective/Key result/Task Screen Recording 2024-05-28 at 7.28.19 PM.mov Screen Recording 2024-05-28 at 7.38.41 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 issue list drawer Feature.enable(:issues_list_drawer)
  3. Enable Epics on group items Feature.enable(:namespace_level_work_items)
  4. To list epic work items on Issues Feature.enable(:display_work_item_epic_issue_sidebar)
  5. (Optional) To edit legacy epics as work items Feature.disable(:make_synced_work_item_read_only)

Data creation:

  1. To test further create a structure like below

    Screenshot 2024-05-28 at 9.22.12 PM.png

  2. Add few Epics to Group A and Group B

  3. Create few Objectives/Issues in Project A and Project B

Steps to verify Parent widget on Epics:

  1. Login with user A
  2. Go to Group B > Epics > List
  3. Create a new Epic
  4. Click on the Epic
  5. Check Parent widget in drawer
  6. It should list Epics from Group A and not Group C
  7. Go to Epic detail page
  8. Go to Parent widget in the sidebar
  9. It should also list the same

Steps to verify Parent widget on Issues:

  1. Login with user A
  2. Go to Project A > Issues > List
  3. Create a new Issue
  4. Click on the issue
  5. Check Parent widget in drawer
  6. It should list Epics from Group B and Group A
  7. Go to Issue detail page
  8. Go to Epic widget in the sidebar and click Edit
  9. It should also list Epics from Group B and Group A
  10. Repeat the steps for Project B
  11. It should list Epics from Group A only

Steps to verify Parent widget on Task:

  1. Login with the same user
  2. Go to Project A > Issues > List
  3. Go to the Issue detail page
  4. Create a Task under Child items
  5. Click on task to open it in a modal
  6. Check Parent widget
  7. It should show the issue as a Parent and list other Issues from Project A

Steps to verify Parent widget on Objective/Key result:

  1. Login with any user
  2. Go to Project A > Issues > List
  3. Create an new Objective under New Issue split button
  4. Click on the Objective
  5. Check Parent widget in the drawer
  6. It should list Objectives from Project A
  7. Go to Objective/Key result detail page
  8. Check Parent widget in the sidebar
  9. It should also list the same

Related to #430141

Edited by Rajan Mistry

Merge request reports