Skip to content

Assigned TODOs are properly created for group level issues

Mario Celi requested to merge 426471-group-level-work-item-assignees into master

What does this MR do and why?

Issues and Work items can now be created directly associated with a group. TODOs get created when assignees of the Issue/WorkItem are changed. This change fixes the TodoService for group level issues and work items

How to set up and validate locally

  1. Enable the feature flag in Rails console Feature.enable(:namespace_level_work_items)
  2. Create a group level work item with the following query at http://127.0.0.1:3000/-/graphql-explorer so you can use it in the next query
    mutation {
       workItemCreate(input: {namespacePath: "flightjs", title: "test group level work item", workItemTypeId: "gid://gitlab/WorkItems::Type/1"}) {
         errors
         workItem {
           id
           iid
         }
       }
     }
  3. Update the assignees on the newly created work item
     mutation {
       workItemUpdate(input:{id: "<id_returned_in_previous_step>", assigneesWidget: {assigneeIds: ["gid://gitlab/User/1"]}}) {
         errors
         workItem {
           id
           iid
           widgets {
             ... on WorkItemWidgetAssignees {
               assignees {
                 nodes {
                   username
                   id
                 }
               }
             }
           }
         }
       }
     }
    Before this change, you will get and undefined method for nil error. Now in the response you should see the specified user is assigned to the work item. Also, the specified user should have a new TODO in their list (the specified user can be the current user).

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 #426471 (closed)

Edited by Mario Celi

Merge request reports

Loading