def BUILD_PROJECT = "projectB"+"/"+env.BUILD_BRANCH
build job: BUILD_PROJECT, parameters: [[$class: 'BooleanParameterValue', name: 'UPSTREAM_TRIGGERED', value: true]]withEnv(["UPSTREAM_TRIGGERED=true"]) { def BUILD_PROJECT = "projectB"+"/"+env.BUILD_BRANCH build BUILD_PROJECT}
StringBuilder builder = new StringBuilder() builder.append("PROP1=true") builder.append("\n") builder.append("PROP2=true") final def propertiesContent = builder.toString()
def info = new EnvInjectJobPropertyInfo(null, propertiesContent, null, null, null, false) def property = new EnvInjectJobProperty() property.setOn(true) property.setKeepJenkinsSystemVariables(true) property.setKeepBuildVariables(true) property.setInfo(info)
project.addProperty(property) project.save()properties [<object of type org.jenkinsci.plugins.envinject.EnvInjectJobProperty>]
properties([[$class: 'ParametersDefinitionProperty', parameterDefinitions: [[$class: 'BooleanParameterDefinition', defaultValue: false, description: 'Parameter Text', name: 'MY_PARAM']]]])def myBoolParam = false
if (getBinding().hasVariable("MY_PARAM")) {
myBoolParam = Boolean.parseBoolean(MY_PARAM)
}