Any one facing the same problem and using pipeline project, set JENKINS_NODE_COOKIEJENKINS_NODE_COOKIE
instead of BUILD_IDBUILD_ID
.
Dont waste your time setting HUDSON_COOKIEHUDSON_COOKIE
, HUDSON_SERVER_COOKIEHUDSON_SERVER_COOKIE
, JENKINS_COOKIEJENKINS_COOKIE
or JENKINS_SERVER_COOKIEJENKINS_SERVER_COOKIE
. None of them work for pipeline project.
Refer to https://issues.jenkins-ci.org/browse/JENKINS-28182 for more details.