Question on "linkedIssuesOf" issue function on Script Runner

Jonathan Kim March 2, 2016

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 votes
JamieA
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.
March 2, 2016

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

Jonathan Kim March 2, 2016

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. 

JamieA
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.
March 2, 2016

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

Jonathan Kim March 3, 2016

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.

JamieA
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.
March 6, 2016

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

Kim Kane
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 7, 2016

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")

Jonathan Kim March 7, 2016

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
TAGS
AUG Leaders

Atlassian Community Events