Hi folks,

How can I configure plugins programmatically, like setting form data that
is usually configured manually in the web interface? It seems that the
preferred approach would be to use Groovy, so this is what I have:

    def manager = jenkins.model.Jenkins.instance.getPluginManager()
    def plugin = manager.getPlugin("some-plugin")
    def loader = manager.uberClassLoader
    def cls = loader.loadClass("org.jenkinsci.plugins.some.PluginTrigger")

The problem is that the Trigger API defines a configure method that takes
a StaplerRequest and a JSONObject that presumably takes the whole form
data from the /configure interface. How do I proceed to set a specific
form field to a given value?

-- 
Marc Tardif <[email protected]>
Freenode: cr3, Jabber: [email protected]
1024D/72679CAD 09A9 D871 F7C4 A18F AC08 674D 2B73 740C 7267 9CAD

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to