Epic quick-actions are not resolved from Service Desk issue templates

Summary

(Issue is similar to: #243790 (closed))

Group level epics are not linked to issues that are created via Service Desk templates that use the /epic quick actions.

Initially reported by a customer in https://gitlab.zendesk.com/agent/tickets/190640 (internal use)

Steps to reproduce

  1. Create a new project within a group of your choosing

  2. Test a service-desk email, notice that an issue is created - all normal.

  3. Create an epic at the group level, capture its ID (&1 or etc.)

  4. Create the file .gitlab/issue_templates/test.md and populate it with this content:

/epic &1
  1. Configure Service Desk to use this template

  2. (FIRST PROBLEM) Email the Service Desk address and notice that no issues are created anymore.

  3. Change the epic created at (3) to be confidential

  4. (SECOND PROBLEM) Email the Service Desk address again and view the issue (gets created this time) - no epic is linked.

What is the current bug behavior?

Service Desk issues don't create themselves if /epic points to non-confidential epic ID.

Service Desk issues created do not link to the epic when /epic points to confidential epic ID.

What is the expected correct behavior?

All forms of /epic quick actions in service-desk appended issue templates should work and link the epic to the created issue on the right sidebar.

Output of checks

This bug happens on GitLab.com.

Edited by Harsh Chouraria