Hey guyz,
I stuck here, can you help me pls.
I have 2 issue. For example issue A and B. In issue A, i have a custom field and it's name Sprint. I created scripted custom field "Sprintvalue" in issue B. I want to get value of Sprint and show it in Sprintvalue.
B created by A btw. İssue type=created by
I am using text field template
i have code like this but does not work:/
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.CustomFieldManager
def componentManager = ComponentManager.getInstance()
def issueLinkManager = componentManager.getIssueLinkManager()
def cfManager = ComponentManager.getInstance().getCustomFieldManager()
def SP = ""
issueLinkManager.getOutwardLinks(issue.id).each {issueLink ->
if (issueLink.issueLinkType.name == "created by") {
def linkedIssue = issueLink.destinationObject
cf = cfManager.getCustomFieldObjects(issue).find {it.name == 'Sprint'}
SP = linkedIssue.getCustomFieldValue(cf)
}
}
return SP