I have an edge use case where a user is looking to create a query of all issues related to several epics. These epics are all linked through an issue link to a 'source epic' and we want to find all tasks under all related epics. Is this possible through JQL or one of the apps such as Scriptrunner/JQL extensions?
Thanks
Hi Ahmad
You can use ScriptRunner Enhanced Search or the standalone Enhanced Search app to do this, using our issuesInEpics function. If your source epic is called "EPIC-1" and your link type is "relates to" you can use the following query on the Enhanced Search page:
issueFunction in issuesInEpics("issue in linkedIssues(EPIC-1, "relates to")")
If you are specifically looking for tasks, you can add the task type to further filter your results
issueFunction in issuesInEpics("issue in linkedIssues(EPIC-1, "relates to")") and type = Task
Best regards,
Romy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have 2 approaches to get this information. The first is by using the Enhanced Search from ScriptRunner for Jira Cloud and using this query:-
issueFunction in issuesInEpics("project = MOCK and key in ('MOCK-19')")
Modify the project key accordingly and issue keys accordingly.
If you are not using the Enhanced Search, then you will need to run the JQL Query like:-
(parentEpic in (11500, 11498) AND issuetype != Epic)
The numbers 11500 and 11498 are the Epic issue ids. To get the Epic Ids, you will need to run the query below on the ScriptRunner console:-
def issueKey = 'MOCK-19' //Change the Epic Key according to your environment
def result = get("/rest/api/2/issue/${issueKey}").header('Content-Type', 'application/json').asObject(Map)
The output returned will be something like:-
{ "headers": { .....
..... }, "statusText": "OK", "parsingError": { "empty": true, "present": false }, "body": { "expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations,customfield_10095.properties,customfield_10096.properties,customfield_10010.requestTypePractice", "id": "11500", "self": "https://<YOUR_URL>.atlassian.net/rest/api/2/issue/11500", "key": "MOCK-19",
....
....
....
}
You must use the id value, as I have shown in the JQL query, to get your linked issues.
I hope this helps solve your question. :-)
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ram Kumar Aravindakshan _Adaptavist_ so in the approach above i have to know the Epic ID's through a separate query. Is there not a way to get the data without knowing the Epic ID's or Keys?
We have TICKET-1 linked to TICKET-2 and both has tasks underneath, but i only know TICKET-1's key.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A note as well, we should assume we don't know the keys of the related epics, and only have the source epic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.