Hi,
Using Script runner I'd like to read all the 'Linked Epic Issues' from the epic object and create a script Field to be used on my card layout. Basically I want to display an epic with all the Linked Epic Issues on my board.
Reading normal links is pretty simple:
JiraAuthenticationContext authContext = ComponentManager.getInstance().getJiraAuthenticationContext();
IssueLinkManager issueLinkManager = ComponentManager.getInstance().getIssueLinkManager();
LinkCollection linkCollection = issueLinkManager.getLinkCollection(issue, authContext.getLoggedInUser());
Set<IssueLinkType> linkTypes = linkCollection.getLinkTypes();
return linkCollection.getAllIssues().toString()
But how to read the Linked Epic Issues
CustomFieldManager cfManager = ComponentManager.getInstance().getCustomFieldManager();
CustomField cf = cfManager.getCustomFieldObjectByName('Linked Epic Issues');
return cf.getGenericValue().toString()
returns
[GenericEntity:CustomField][id,10201][project,null][fieldtype,null][default,null][issuetype,null][customfieldsearcherkey,com.onresolve.jira.groovy.groovyrunner:textsearcher][description,null][name,Linked Epic Issues][customfieldtypekey,com.onresolve.jira.groovy.groovyrunner:scripted-field]
I can see that there is API EpicLinkManagerImpl
https://docs.atlassian.com/greenhopper/6.3.6.1/com/atlassian/greenhopper/manager/issuelink/EpicLinkManager.html#getIssuesInEpic%28com.atlassian.jira.issue.Issue%29
And even some examples
https://gist.github.com/ark09/c62a20c4cdae3f98df85
But
def epicLinkManagerImpl = getBean("epicLinkManagerImpl");
Returns
javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getBean() is applicable for argument types: (java.lang.String) values: [epicLinkManagerImpl]
Possible solutions: getAt(java.lang.String), get(java.lang.String), getClass(), eval(java.lang.String)
A stacktrace has been logged
And when I try to import the EpicLinkManagerImpl I'm getting
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script65.groovy: 19: unable to resolve class com.atlassian.greenhopper.manager.issuelink.EpicLinkManagerImpl
@ line 19, column 1.
import com.atlassian.greenhopper.manager.issuelink.EpicLinkManagerImpl
So the package is not visible from the Script Runner at all.
So How do I access the instance of the EpicLinkManagerImpl then?