Evaluate a Groovy script and inject a map result.
The groovy script must return a map Java object.
You can access parameters and other environment variables through variables in the Groovy script.
For example, the Groovy can compute environment variables from user input parameters, such as:
if (CASE==null){
return null;
}
def stringValue="StRinG";
if ("upper".equals(CASE)){
def map = [COMPUTE_VAR: stringValue.toUpperCase()]
return map
}

if ("lower".equals(CASE)){
def map = [COMPUTE_VAR: stringValue.toLowerCase()]
return map
}

This script injects the COMPUTE_VAR environment variable according the CASE parameter value.

Moreover, 'currentJob' variable and 'currentBuild' variable are available if you want to have an access to the current Job instance and the current Run instance.
You are aslo able to add logging through the 'out' variable.