I have this query (below) however it is not pulling in the epics that are in the sub milestones:
(issueFunction in linkedIssuesOf("key= Bankmod-15882", "relates to") OR issueFunction in issuesInEpics("issueFunction in linkedIssuesOf(\"key = Bankmod-15882\", \"relates to\")")) AND Issuetype in (milestone, epic)