// get the first component out of the components list sent over from the customer jira
def remoteComponentName = replica.components?.first().name
// component map allows to map the name of the component to the local value
def componentMapping = [
// "remote component name" : "target parent"
"HW" : "Hardware",
"Cluster" : "Cluster",
"Android-HAL" : "IVI",
]
// Find the mapped value, default to 'Hardware'
def targetValue = componentMapping[remoteComponentName] ?: "Hardware"
def parent = nodeHelper.getOption(issue, "FunctionGroup", targetValue)
issue.customFields."FunctionGroup".value = nodeHelper.getCascadingSelect(parent,"")