Consider below JSON. I want to match each of temp has a partial string matching 'process' using a OR condition i.e. in each temp either severity or conditionName should have a partial matching of 'process'
* def temp = [{ "severity": "Critical","conditionName": "process"}, { "severity": "Critical 2","conditionName": "process 2" }, { "severity": "Critical 2","conditionName": "processor" } ]
I tried below code:
* def isMatch = function(x) { return x.severity == '#regex (?i).*process.*' || x.conditionName == '#regex (?i).*process.*' }
* match each temp == '#? isMatch(_)'