Bug: When adding sub epic from sub group, wrong epic is added

Summary

On an epic page, "Add Existing Epic", if you search for & select an epic that's from a sub group, it instead adds the epic with the same numeric ID within the current group

Steps to reproduce

Suppose you have the following setup:

  • Parent Group contains sub group named "Sub Group"
  • Parent Group contains epic &​1 called "Apple", and epic &​2 called "Banana"
  • Sub Group contains epic &​1 called "Cherry"

Within the "Banana" epic, choose "Add an existing epic"

Within the box that comes up, type "&​Cherry" - you will see the Cherry epic come up as an option. Click it.

When you click "Add", the link is added to the "Apple" epic, not the "Cherry" one

Example Project

(I can't do this as I only have Gold access within our private project)

What is the current bug behavior?

The Epic with the wrong ID is linked to

What is the expected correct behavior?

The intended epic is linked to

Relevant logs and/or screenshots

(Afraid not possible without sharing confidential details)

Output of checks

This bug happens on GitLab.com

Possible fixes

(Unknown)

Edited by John Hope