I'm trying to create a mapping based on a value. However, whatever I try to save the component template, I'm shown the following error:
Unable to create component template
Failed to parse mapping: compile error
The runtime field component mapping I'm trying to create is:
if (!doc['policy_evaluated.spf'].value.equals('None') &&
doc['policy_evaluated.spf'].value.toLowerCase().equals("pass"))
{
return true
} else {
return false
}
In examples of scripts with if statement I see them wrapped in """
, but with or without, I get the same error.