Im using the Groovy Postbuild plugin and trying to modify an exists job environment variable as to some test Im running on the jobs log:
def map = ["x":"", "y":"", "z":""]
map.each{
it.value = (manager.getLogMatcher("$it.key(.*)\$")).toString().split(':')[1]
}
if(map.get('X') == ""){
job_environment_variable = FOO
}
else {
job_environment_variable = BOO
}