Hello All,
Thanks in advance for the assistance on this. I have the following script field created in JIRA with Scriptrunner to return the content of our Program issue types.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.AbstractIssue
import com.atlassian.jira.issue.Issue
Issue issue = issue
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def baseurl = ComponentAccessor.getApplicationProperties().getString("jira.baseurl")
def issueList = [:]
issueLinkManager.getInwardLinks(issue.id).each {issueLink ->
if (issueLink.issueLinkType.name == "Program")
{
issueList.put(issueLink.getSourceObject().getKey(), issueLink.getSourceObject().getSummary()) }
}
//def customFieldManager = ComponentAccessor.getCustomFieldManager()
//def EpicLink = customFieldManager.getCustomFieldObjectsByName("Epic Link")
//def Epic = getCustomFieldValue(EpicLink)
def Epic = (AbstractIssue) getCustomFieldValue("Epic Link")
if (Epic) {
issueLinkManager.getInwardLinks(Epic.id).each {issueLink ->
if (issueLink.issueLinkType.name == "Program")
{
issueList.put(issueLink.getSourceObject().getKey(), issueLink.getSourceObject().getSummary()) }
}
}
def programURLs = ""
issueList.each
{issueKey, issueSummary -> programURLs += "<a href=\"" + baseurl + "/browse/" + issueKey + "\">" + issueSummary + "</a><br/>" }
return programURLs
It was all working just fine until my last version of JIRA which is 7.13. After we recently upgraded. It stopped working. My code itself doesn't return any error but when i run it i get the following error
2019-12-30 11:16:08,263 ERROR [runner.ScriptFieldPreviewRunner]: ************************************************************************************* 2019-12-30 11:16:08,263 ERROR [runner.ScriptFieldPreviewRunner]: Script field preview failed for field that has not yet been created groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getCustomFieldValue() is applicable for argument types: (java.lang.String) values: [Epic Link] at Script45.run(Script45.groovy:21)
Please assist. Really cannot figure out what the issue is.
PS: For some reason code block will not work for me on this post. Sorry for the mess