I have created a Global config variable to store some value and retrieve it
during the execution. Now, I was able to access the data from the Global
variable that I have declared. But to my surprise, I am unable to view the
data when I go to configuration for next time. But still, I am able to
access the field value. Thanks in Advance.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"
xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:a="/lib/auth">
<f:section title="${%Google Cloud}">
<f:entry title="${%Gcloud Installer Path}" field="gcloudpath">
<f:textbox name="gcloudpath"/>
</f:entry>
</f:section>
</j:jelly>
@Override
public boolean configure(StaplerRequest req, JSONObject formData)
throws FormException {
// To persist global configuration information,
// set that to properties and call save().
gcloudpath = formData.getString("gcloudpath");
// ^Can also use req.bindJSON(this, formData);
// (easier when there are many fields; need set* methods for
this, like setUseFrench)
save();
return super.configure(req,formData);
}
Following are the sample code snippets. Please don't mind if I did a silly
mistake.
--
Sent from:
http://jenkins-ci.361315.n4.nabble.com/Jenkins-dev-f387835.html