I am new to Jenkins Plugin development so pardon me if the question is silly. I am currently developing a Jenkins Plugin that provides a very small list of configuration options
After some research I have got to know how to update the config file through user defined form.
PFB Code
AbstractItem item= (AbstractItem) Jenkins.getInstance().getItemByFullName(itemName)
Source streamSource = new StreamSource(new StringReader(config))
item.updateByXml(streamSource);
item.save();
In the jelly the form has to called the method like this
So the code to update has to be placed in the method as follows
public void doConfigSubmit(StaplerRequest req, StaplerResponse rsp) throws
IOException, ServletException, Descriptor.FormException