Skip to content

Add type quick action for converting work items type

What does this MR do and why?

Related to #385227 (closed)

Adds the /type quick action to convert a work item to the specified type. This command is behind the feature flag work_items_mvc_2

Note that flash notifications are not yet implemented for the work item view so the command message will not be displayed (issue: Surface quick action errors (#391281)).

This MR also adds a new usage counter event (needed for QuickActions::InterpretService#usage_ping_tracking).

Screenshots or screen recordings

convert_work_item

How to set up and validate locally

  1. In rails console enable the feature flag and create a task
    Feature.enable(:work_items_mvc_2)
    
    project, user  = Project.first, User.first
    type = ::WorkItems::Type.default_by_type(:task)
    task = WorkItem.create!(project: project, author: user, title: 'Test task to convert', issue_type: :task, work_item_type: work_item_type)
    task_url = "http://gdk.test:3000/#{project.full_path}/-/work_items/#{task.iid}"
  2. Visit the task URL and try the quick action in a comment: /type Issue
  3. Verify that a new note is created and the type changed to issue:
Click to expand screenshot

Screenshot_2023-04-26_at_16.31.12

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

Loading