Fix for Jenkins 14545

This fix also includes new Env variables for cases when the parameter factories are used and multiple builds are triggered.

https://issues.jenkins-ci.org/browse/JENKINS-14545