Question on "linkedIssuesOf" issue function on Script Runner

Hi, 

I have a project A and B, and tickets under those two projects were linked each other. I'd like to find out all the tickets in A that has linked to ticket B which have closed status. Is this possible?

Here is my query but it didn't work.

project = Project_A AND issueFunction in linkedIssuesOf("project=Project_B and status=Closed", "link_type")

1 answer

0 vote

That looks right, but link_type should be the link direction, eg "duplicates" or "is duplicated by". 

Check the docs: https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_linkedissuesof

Hi Jamie,
First, thank you for your quick response.  However, the query above also returns tickets under Project_A that have linked to ticket B which is not closed. Is it bug?

For example, A ticket A-1 (parent to) linked to a ticket B-1 (child to). ('parent to' and 'child to' are link directions). Although the ticket B-1 is not closed status, A-1 is found in my script runner 'linkedIssueOf' issue function. 

Does A-1 also have links to another B that is closed?

Sorry for the belate reply. I couldn't comment/question more than twice per day. sad 

Anyway, my answer to your question is No. BTW, the ticket A-1 has same link types to another project tickets C-1, C-2 ..etc that were closed.

Can you modify your query to add "and key = ABC-1", where that issue is one that you think should not be returned by your query. Then paste a screen shot of the issue and the actual query.

If you have confidential information you can't redact you can create a support ticket at productsupport.adaptavist.com/servicedesk/customer/portal/2

The following is working:

project = Proj_A AND NOT issueFunction in linkedIssuesof("project = Proj_B and status in (Opened, Assigned, 'In Progress', Resolved)") AND issuefunction in linkedIssuesof("project = Proj_B and status = Closed")

Hi Jamie, 
Actually, I was wrong on your question of "Does A-1 also have links to another B that is closed?". Yes, A-1 has links to another B that is closed. Apparently, I overlooked 'Show xx more links' to get the entire list of links. Therefore, A-1 is linked to B-1 and B-2, and only one of B tickets got closed.


Question 1: Is this an expected behavior?

Question 2: What should the query be if I want to find all the A tickets which linked tickets under project B are ALL closed. (Kim mentioned another query above, and the query seems working. The last two phrases - "NOT issueFunction in linkedIssuesof("project = Proj_B and status in (Opened, Assigned, 'In Progress', Resolved)") " and "AND issuefunction in linkedIssuesof("project = Proj_B and status = Closed")" sounds same to me. I wonder why this query results differently than mine above.)

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

165 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you