You can create a Script Runner Scripted Field.
The script for the field will look like:
import com.atlassian.jira.component.ComponentAccessor a = ComponentAccessor.getIssueLinkManager().getLinkCollection(issue, issue.reporter).getAllIssues().size() a.toString()
More info on scripted fields:
https://jamieechlin.atlassian.net/wiki/display/GRV/Scripted+Fields
Which part did not work ?
Is the field shown with wrong value or it is not there at all ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Boris, I needed to count specific type of linked issues. Ex:- issue has 2 type of linked issues, 2 linked as blocks and 2 linked as clone. How can i get these separately. Current answer is 4, but i need 2
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thuy Mai,
Try Database Value plugin and select
count(*)
from
issuelink
where
SOURCE=(
select
id
from
jiraissue
where
pkey=
'${jira.issue.key}'
)
or
https://answers.atlassian.com/questions/215718/scripted-field-to-return-number-of-cloned-issues-not-workingscripted field will help you most rather than DB value plugin.
I think its little bit closer to your requirement.
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi - does anyone have a script sample for the cloud version? Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Worked with a slight modification of Boris script:
import com.atlassian.jira.component.ComponentAccessor
def CountLink = ComponentAccessor.getIssueLinkManager().getLinkCollection(issue, issue.reporter).getAllIssues().size()
CountLink.toString()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Amazing, thank you :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Philippe Puy ,
I faced a problem for this script. Do you know how to count the number of linked issues base on linked issues type? Thank you very much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thuy Mai,
Try Database Value plugin and select
count(*)
from
issuelink.
I think its little bit closer to your requirement.
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thuy Mai,
Try Database Value plugin and select
count(*)
from
issuelink.
I think its little bit closer to your requirement.
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.