Single Jira Jql to get the list of linked issues fileds

QueenMary Bastin May 18, 2021

I will explain the case for which I need a Single JQL.

We need to query a Jira issue which has a linked issue in and and get the specific fields of both current issue and Linked issue.

For example there is a jira issue called TEST-123 which has a linked issue called SAMPLE-123.

Both the Jira issue has a custom field called Notes.

Now the JQL has to return the custom fields value Notes from the TEST-123 and SAMPLE-123 in single Query.

I know we can get a list of linked issues and then fetch the linked issues required fields but the time to run the script will be longer as we are querying two times.

 

Please any help me on this.

That would be great.

 

Thanks,
Queenmary Bastin

2 answers

1 vote
Olga Videc
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 18, 2021

Hello Queenmary,

You can use Scriptrunner's JQL issueFunction in linkedIssuesOf("subquery")

For example

project is Test it's key is TES

This will fetch all the issues that are linked to issues in project TES

issueFunction in linkedIssuesOf("project in (TES) and issuetype=bug") 

 

then you just add OR and add JQL for the rest of the issues you want

project = TES and issuetype = bug 

Full JQL

ssueFunction in linkedIssuesOf("project in (TES) and issuetype=bug")  OR (project = TES and issuetype = bug)

BR, Olga 

QueenMary Bastin May 18, 2021

Hi Olga,

Thank you for your response.

But here what I need is I want to get the custom field for example "Notes" from the linked issues.

Get the linked issue of a Project Test and get the Custom Field named Notes value of the linked issues.

Can you please help on this...

Regards,
Queenmary Bastin

OMAR MOHAMED AHMED MOHAMED FATHY September 5, 2023

did you find a solution for this? @QueenMary Bastin 

0 votes
Jennifer Hart November 6, 2023

I would also like to know if there is an out of box solution for this.

Suggest an answer

Log in or Sign up to answer