On a workflow transition I need to check that a parent issue has children with the Portfolio 'Parent Link' field which appears to work:
cfValues['Parent Link'] == null
However in creating the new child issue I am unable to set the
def cf = customFieldManager.getCustomFieldObjects(sourceIssue).find {it.name == 'Parent Link'}
issue.setCustomFieldValue(cf, sourceIssue.key)
The following error is returned:
2018-05-29 07:47:17,418 ERROR [workflow.ScriptWorkflowFunction]: Script function failed on issue: EPIC-42, actionId: 81, file: null
groovy.lang.MissingPropertyException: No such property: Key for class: com.atlassian.jira.issue.IssueImpl
Possible solutions: key, id
at Script346.run(Script346.groovy:6)