You can't do this, if I understand the question correctly.
The heirarchy for JIRA Software is basically
Epic -> Story level -> Sub-task level
Issues at a story level can belong to Epics (but don't have to). Sub-tasks belong to a single parent, but that parent can be a story level issue, or an Epic. But as they can only belong to one, you can't have a sub-task that belongs to an Epic and a Story. (If you could, you could easily completely break your data, having a sub-task that belongs to a story that belongs to an Epic that isn't the one the sub-task is co-located on).
The implication is that a sub-task belongs to a story, and because of that ownership, when the story is in an Epic, all of its subtasks are in the epic too.
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs