Skip to content

Relate quick actions doesn't sync back to legacy epics

Bug description

When using the /relate quick action on epic work items, we don't sync the data back to the legacy epic.

How to reproduce

  1. Go to an epic
  2. Create a comment with /relate #OTHER_EPIC_IID
  3. Add ?force_legacy_view=true to the URL
  4. The related epic is not shown

The problem

In the InterpreterService, we use the IssueLinks::CreateService, not the WorkItems::CreateService. Therefore the code to create the synced legacy epic data is never called.

The /unlink action has the same problem, but due to the FK constraint, the related_epic_links record will be deleted anyway.

This got introduced in %17.7 with !172901 (merged).

Impact

On GitLab.com it's just 4 related epics that are mismatched. There is no visible user impact, as they still see the work item version. However:

  • Epic-Epic relations that are linked via /relate don't have the legacy record
  • When using the REST or GraphQL Epic API, the linked items would not be shown

How to fix

  1. Use the proper service
  2. Backfill the data OR fetch the data from work items
Edited by Nicolas Dular