Skip to content

Fix work item status fallback to use lifecycle-aware default

What does this MR do and why?

When work items lack a current status record, they were incorrectly falling back to the system-defined default status (open/closed/duplicated) even when a namespace transitioned to using custom lifecycles and statuses.

This MR updates the status_with_fallback method to:

  • Fetch the appropriate lifecycle for the work item's root namespace
  • Implement SafeRequestStore caching for performance optimization
  • Handle both custom and system-defined lifecycles properly

Notes

  • When filtering by status, we also need to make sure that work items without a current status are filtered correctly. The fix will be addressed via a separate issue.

References

Screenshots or screen recordings

Before After
Screenshot_2025-10-10_at_11.08.36_am Screenshot_2025-10-10_at_2.12.22_pm

How to set up and validate locally

  1. Enable the work_item_status_mvc2 feature flag.
  2. Create a new group and project.
  3. Create a few issues and assign the Done status to them.
  4. Delete the current status record from the last issue: WorkItem.last.current_status.delete.
  5. Navigate to the issues settings page.
  6. Add a new status named New default under the Done category.
  7. Mark New default as the default closed status.
  8. Navigate to the issues list page.
  9. Before the fix: The issue without a current status referenced an incorrect Done status.
  10. After the fix: The issue without a current status correctly references the default status New default.

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.

Edited by Agnes Slota

Merge request reports

Loading