How to get the list of all linked tickets to the Main Ticket?

Mohamed El Taweel October 17, 2018

Hi,

When viewing ticket T-1, it shows the below tickets under "Issue Links"

T2 and T3 are Inward Linked to T-1

T4 and T5 Outward linked to T-1

I wrote script runner validation script to  list the Inward linked tickets and check its status

 

How can I list all linked tickets (T2,T3,T4,T5) using script runner so I can check the status of every one?

Example :

T-1 : Main Ticket

..

"Issue Links"

     T2

     T3

     T4

     T5

 

Thanks

1 answer

0 votes
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 17, 2018

Hi @Mohamed El Taweel

If you have Scriptrunner you can do it with JQL

You can use expression like:

Haslink

Haslinktype

Linkedissuof

https://jamieechlin.atlassian.net/wiki/spaces/GRV/pages/33030163/Scripted+JQL+Functions

 

Regards

Mohamed El Taweel October 17, 2018

Hi @Mohamed Benziane


The following Jql returned all the linked issues,  "project = "Test Development Project" AND issue in linkedIssues(T-1) "

What I need is that up on the Close transition I need to validate that all the linked issues are closed, so I need a script runner script to  list all of the linked issues and check the status of each one.

Thanks,

Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 17, 2018

Hi @Mohamed El Taweel

 

Scriptunner have a workflow condition "Allows the transition if this query matches a JQL query'" so you can in your workflow use this to make sure that the close transition it enable only if all linked issues are closed.

 

Hope this helps

Mohamed El Taweel October 17, 2018

Hi @Mohamed Benziane,

Based on your suggestion the condition will be

project = "Test Development Project" AND issue in linkedIssues(T-1) and status =Done ", but T-1 is not constant, it is the the ticket being transitioned.  I believe it can be replaced with a function which return the ticket id, For example linkedIssues(issue.key)

Thanks,

Suggest an answer

Log in or Sign up to answer