Hey everyone,
I need to show (on a dashboard) the number of links a JIRA has. I've looked into plugins (like SnapMetrics) but I believe the best way is to write a Groovy Script that essentially calls issue in linkedIssues([issueid]) and then stores the result in a custom field of the issue. I can then display the custom field on the dashboard.
My coding is rusty, however, and I was wondering if anyone could point me in the right direction as to how I would go about this?
Thanks in advance,
Lee
Assuming you have Scriptrunner - create a new scripted field, with a number searcher, and set for a numeric output.
Then the script you need can be condensed down to one active line:
return issueLinkManager.getLinkCollectionOverrideSecurity(issue).size()
Many thanks Nic,
Do I need to import a specific com.atlassian class? I ask because I am receiving an error stating:
groovy.lang.MissingPropertyException: No such property: issueLinkManager for class: Script44 at Script44.run(Script44.groovy:2)
Thanks again,
Lee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to mention that I experimented with adding the following:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.IssueManager
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
I'm not getting the error:
groovy.lang.MissingMethodException: No signature of method: com.atlassian.jira.issue.link.LinkCollectionImpl.size() is applicable for argument types: () values: [] Possible solutions: is(java.lang.Object), find(), sleep(long), find(groovy.lang.Closure), use([Ljava.lang.Object;), with(groovy.lang.Closure)
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.