Include work item status change in the issue reopen webhook
What does this MR do and why?
When a work item is reopened (for example through the /reopen quick action), its work item status transitions back to an open status, but the workflowcomplete label is not cleared and the old label remains. This happens because the reopen webhook did not include the status change in its changes payload.
This MR fixes that by making Issues::ReopenService include the status change in the reopen webhook. It passes the item's status as old_associations to the existing hook call. This only happens when the work item has a current status record and the work_item_status feature is licensed, otherwise nothing changes.
This is the reopen counterpart to !259542 (merged) (#604636 (closed)), which fixed the close path the same way. The update path (status widget, Close and Reopen buttons) was already fixed in #604714 (closed) (!243503 (merged)). The /reopen quick action goes through the reopen webhook event, which that fix did not cover.
Scope: this MR only affects work items that already have a current status record. Backfilling the missing records is handled separately in #629280 (closed), it is not part of this MR.
Next steps
- The triage-ops follow-up: the
StatusLabelSyncProcessorreacts only toupdateandopenevents today. We will add the reopen events (issue.reopen, andwork_item.reopenif that webhook fires) so the sync runs on reopen and clears or updates the workflowcomplete label. This mirrors the close follow-up (gitlab-org/quality/triage-ops!4414 (merged)).
References
- Issue: #632254 (closed)
- Close counterpart: !259542 (merged) (#604636 (closed))
- Update path, already fixed: #604714 (closed) (!243503 (merged))
How to set up and validate locally
Click to expand
- Create an issue and give it a status, then close it so it has a closed status (for example
Complete) and a current status record. - Set up a project webhook to capture issue hooks.
- Reopen the issue with the
/reopenquick action. - Observe that the reopen webhook payload now includes the status change under
changes.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.
