I have tried above , but it is not working .
Actual issue is below assignment is not working with system groovy script ,
it is returning null value.
def ARTIFACT_VERSION=currentBuild.getEnvironment()['POM_VERSION'];
====> POM_VERSIOM has values xxxx
def artifactVersionParam = new
hudson.model.StringParameterValue("ARTIFACT_VERSION", ARTIFACT_VERSION)
def artifactVersionParamAction = new
hudson.model.ParametersAction(artifactVersionParam);
currentBuild.addAction(artifactVersionParamAction);
println currentBuild.getEnvironment()['POM_VERSION'];
=====> output : xxxx
println currentBuild.getEnvironment()['ARTIFACT_VERSION'];
=====> output : null
Because of this such variables are not accessible in environment variables
in shell. It is working as expected in jenkins 1.X version.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/eabb18db-1db3-4b2d-a425-d421b52bcd56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.