Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JQL to find issues with links to a specific issue type

Dave Stillwell
Contributor
December 5, 2023

I have been trying to create a search that will list all issues with a specific link type linked to a specific issue type.  So far I have issuetype = "A" AND issueFunction in hasLinks('X').  This will give me all A type issues that have a link type of X, which is great but in order to get what I am looking for is to filter further and limit the list to issues that have a X type link to another A type issue. So basically, I am looking to fulfill the following logic

Does the issue have a type X link and does that link X link to a type A issue.

1 answer

1 vote
Laurie Sciutti
Community Champion
December 5, 2023

Hi @Dave Stillwell ~ maybe something like this?

issuetype = "A" AND issueFunction in linkedIssuesOf("issueFunction in hasLinks('X')")
Dave Stillwell
Contributor
December 5, 2023

Hmm that does give me less results (92 v, 120). Need to go through the results to check if it worked.  

Dave Stillwell
Contributor
December 5, 2023

@Laurie Sciutti That didn't work.  Maybe a bit more detail would help.

We have 2 issue types: Warranty Request and Quality Issue.  There are times when we need to create a Quality Issue based off a Warranty Request and then link the Warranty Request to the Quality Issue with a Requires Quality Issue link type.  Some Agents (using JSM) mistakenly link the Warranty Request to another Warranty Request using the Requires Quality Issue link type.  What I am looking to do is search for issues that have these incorrect links and fix them so only Quality Issues are linked with link type Requires Quality Issue.

Laurie Sciutti
Community Champion
December 5, 2023

OK.  how about this, @Dave Stillwell ?

issueFunction in linkedIssuesOf("type = 'Warranty Request'", "Requires Quality Issue") and type = "Warranty Request"

 

Dave Stillwell
Contributor
December 5, 2023

@Laurie Sciutti

The query only returned 25 records, but some results don't have a Requires Quality Issue linktype and some have Require Quality Issue linktype but are not linked to a Warranty Issue. 

I appreciate you taking the time to look at this. :)  I have been digging through searches on the web and can't find anything that indicates that it is possible for a ScriptRunner JQL query to look at the linked issues and determine the issuetype of the linked issue.

Suggest an answer

Log in or Sign up to answer