My requirement is to simply copy the field values from epic to story during creation.
I am using a custom scripted post-function on the create issue transition.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def issue = issue as MutableIssue
["Vendor Name", "Location", "Group", "GCRS Sector", "Impacted Regions"].each {
def cf = customFieldManager.getCustomFieldObjectByName(it)
def epic = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Epic Link'}
def value = epic.getCustomFieldValue(cf)
issue.setCustomFieldValue(cf, value)
}
as per the answers by @adammarkham here: https://community.atlassian.com/t5/Jira-questions/Using-a-behaviour-to-copy-a-multi-select-custom-field-from-an/qaq-p/579955#U668298
I am getting error at "cannot find matching method getCustomFieldValue"
def value = epic.getCustomFieldValue(cf)
Being new to scripts can you please point me towards some relevant document or example to get this resolved.?