Skip to content

Add promote_to quick action for work items

What does this MR do and why?

Related to #412534 (closed)

Adds /promote_to <Type> quick action for work items. Supported in work items of type 'task', 'issue' and 'key result':

Work item type Supported Type param
Issue Incident
Task Issue
Key Result Objective

This action is essentially performing a type conversion for the work item and is very similar to the existing quick command /type. The reason behind this addition is to bring parity with the concept of promoting existing for legacy issues.

Screenshots or screen recordings

Screen_Recording_2023-06-08_at_11.01.40

How to set up and validate locally

  1. Open the rails console and create 3 work items:
issue_type_id = WorkItems::Type.find_by(name: 'Issue').id
key_result_type_id = WorkItems::Type.find_by(name: 'Key Result').id
task_type_id = WorkItems::Type.find_by(name: 'Task').id

project, user = Project.first, User.first
WorkItem.create!(title: 'key result 1', author: user, project: project, work_item_type_id: key_result_type_id, issue_type: :key_result)
tWorkItem.create!(title: 'task 1', author: user, project: project, work_item_type_id: task_type_id, issue_type: :task)
WorkItem.create!(title: 'issue 1', author: user, project: project, work_item_type_id: issue_type_id, issue_type: :issue)
  1. Visit each one (make sure to use the work items view https://gdk.test:3000/gitlab-org/gitlab-test/-/work_items/<work_item_iid>) and test the quick action in a new comment or by editing the description.
  2. Only the actions used with supported params should succeed. When the action fails the type remains unchanged and an error is displayed (only when using the description, comments don't return quick action errors yet)

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 Eugenia Grieff

Merge request reports