Connect current statuses and custom statuses
What does this MR do and why?
As part of the configurable work item statuses initiative, this MR establishes the relationship between work item current statuses and custom statuses, enabling work items to not only be assigned system-defined but also custom status values.
This builds upon recently introduced tables and models for custom status and lifecycle.
Notes
The actual implementation of custom status-related methods will be introduced in a separate MR via Connect custom status to all abstraction methods.
References
The overview of system-defined and custom status and lifecycle classes can be found in the design doc.
- Add missing FKs on work_item_current_statuses
- BE: Create tables and models for custom lifecycle and status
- Work Items Custom Status Design Doc
- Configurable Work Item Statuses Epic
Screenshots or screen recordings
backend changes only.
How to set up and validate locally
-
Enable the
work_item_status_feature_flag
feature flag. -
Create a new work item (only tasks are supported) in the UI at the project or group level.
-
Use the
/status
quick action to assign a system-defined status to the task. This will create aCurrentStatus
record. -
Complete the rest of the steps via Rails console.
-
Follow instructions from Introduce tables and models for custom status a... (!186050 - merged) to create a custom lifecycle and status. Ensure the custom lifecycle and statuses are created under the same namespace as the work item task.
-
Assign a custom status to the work item's current status.
work_item = WorkItem.last
current_status = work_item.current_status
custom_status = WorkItems::Statuses::Custom::Status.last
current_status.update!(custom_status: custom_status)
- Verify the work item's current status.
work_item.current_status
work_item.current_status.custom_status
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.