JQL to pull custom field value for linked issues

Matt Fetting June 9, 2021

I am starting with a JQL query of:

Label = Cool_Label_Name

This returns my interesting issues, and I can enable the column "Links" to see the Linked issues. Great. Now I'd like to be able to also return the value for one particular custom field (call it "XYZ Item Number") for any Linked items. Right now, with the query as-is, that custom field is empty because it's not trying to pull that from the linked issue, it's pulling it from the results of "Label = Cool_Label_Name"

Hoping to be able to do this, or something very close it, without a plugin!

 

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 9, 2021

Hello @Matt Fetting 

Welcome to the community.

Let me know if I correctly understand what you are trying to do.

You have, for instance, and issue ABC-123 that you want to retrieve.

Linked to ABC-123 are issues DEF-234, DEF-345, and DEF-456.

The DEF issues have a custom field "XYZ Item Number", and the values for each DEF issue respectively are "Item 1", "Item 2", and "Item 3" (for example). 

You want your output to include:

Issue; XYZ Item Number(s)

ABC-123; Item 1, Item 2, Item 3

 

Is that correct?

Matt Fetting June 9, 2021

Yes, that's correct.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 9, 2021

This is not possible with native Jira filtering and results output capabilities. The results output capabilities are designed to give you details in the issues that are selected by your filter, not details in the issues associated with the issues selected by your filter.

The results set would need to be selecting the linked issues (the DEF issues) and displaying details from those. Would it work for you to reconfigure the filter to select DEF issues instead, where those DEF issues are linked to an ABC issue that includes the Cool_Label_Name label?

I have not had the need to produce a report similar to this before, so I can't say definitively that there is a plug in that would help you produce this. A plugin I have used in the past to extend Jira filtering capabilities is Adaptavist Scriptrunner, but I never tried to use it in quite the way you are trying.

Another alternative would be to look at using the REST API and build up code that would extract the data for you.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 9, 2021

Hi @Matt Fetting 

Yes, and...for Trudy's ideas: how often do you need this information? 

If you are doing this one-time, please consider exporting data from a more general query and then use a spreadsheet to match up, "join" the columns you need to check.

If you will need this often, other ways to go are: a marketplace addon, the REST API with custom coding, some Jira automation to dynamically build the query, or use the Jira Excel Add-in (or Google Sheets) to use a spreadsheet you can regularly use with manual joins.

Best regards,

Bill

Like Trudy Claspill likes this
Matt Fetting June 9, 2021

Thanks @Bill Sheboy and @Trudy Claspill 

This is going to be a regular need, so based on your feedback, I'm going to open the door to ScriptRunner. I'll spin up another thread in their support forum to pursue this. Cheers.

Suggest an answer

Log in or Sign up to answer