Closed james-masson closed 4 years ago
https://github.com/ashu16815/persistent-parameter-plugin You may use this
Hi,
This issue is resolved.
Cheers, Ankit
fyi, I was continuing to have issues even with Ankit's changes. It turned out to be security related. I had to give anonymous user permission to read jobs. This allowed the plugin which runs as anonymous the ability the get data from Hudson.getInstance().getAllItems()
Meet same issue with Jenkins Pipeline 2.5.
+1
+1
+1
+1
I found a good workaround with Extended Choice Parameter.
On project configuration, use Extended Choice Parameter
Parameter Type: Text Box
Script type: Groovy Script
Groovy script (same for value and default value):
try {
return jenkins.getItemByFullName(jobName).getLastBuild().getProperties()["environment"][parameterName]
} catch (all) {
return defaultValue
}
Properties:
jobName=Folder/Deploy
parameterName=VERSION
defaultValue=1.0
Same problem :(
issue still persists, the latest value of build not retained.
+1
I found a good workaround with Extended Choice Parameter.
On project configuration, use
Extended Choice Parameter
Parameter Type: Text Box
Script type:
Groovy Script
Groovy script (same for value and default value):
try { return jenkins.getItemByFullName(jobName).getLastBuild().getProperties()["environment"][parameterName] } catch (all) { return defaultValue }
Properties:
jobName=Folder/Deploy parameterName=VERSION defaultValue=1.0
I found a good workaround with Extended Choice Parameter.
On project configuration, use
Extended Choice Parameter
Parameter Type: Text Box
Script type:
Groovy Script
Groovy script (same for value and default value):
try { return jenkins.getItemByFullName(jobName).getLastBuild().getProperties()["environment"][parameterName] } catch (all) { return defaultValue }
Properties:
jobName=Folder/Deploy parameterName=VERSION defaultValue=1.0
Hi! Can you describe your practice in more detail? Maybe you can give an example,thank you so much!
Doesn't work in combination with Jenkins 2.0 Pipelines.
It functions as a parameter just fine, but the successful parameters are not remembered for the next job run.