Hi,
I want to implement a Custom Field in Jira that counts how many links (in total) that depends of issue. Let me to explain better: the only that I want is that have a issue 'A' in project that have another (for example) that depends of issue 'A'. So in CF that I want to create, in this example will have value '1' because only have 1 issue that depends of this issue.
Is this possible to implement in Jira?
Thanks in advance,
Daniel
I do this script with 'Script Runner' plugin and the following code (if any is interested :D ):
import com.atlassian.jira.ComponentManager import com.atlassian.jira.issue.Issue import org.apache.log4j.Category import com.atlassian.jira.issue.link.IssueLink; double numberLinks = 0 linkType = ["Duplicate"] linkMgr = ComponentManager.getInstance().getIssueLinkManager() for (IssueLink link in linkMgr.getInwardLinks(issue.id)) { if (linkType.contains(link.issueLinkType.name)) { numberLinks = numberLinks + 1 } } return numberLinks
to make it more groovy...
import com.atlassian.jira.component.ComponentAccessor def linkType = ["Duplicate"] return ComponentAccessor.issueLinkManager.getInwardLinks(issue.id)).count { linkType.contains(it.issueLinkType.name) }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can use the Script Runner plugin and create a scripted custom field which counts the links.
Henning
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to note - it will show correct value on issue view screen, but for accurate value in issue navigator (and search indexes) you should develop some sort of reindexing for linked issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Really? I think the act of linking causes both source and target to be reindexed.
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.
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.