Hi Calvin,

Jenkins.instance vs Hudson.instance? Which contains what and why?

   - There is no real difference. "Hudson.getInstance()" xists for 
   compatibility reasons but returns the same object


As designed, there is no "tasks" in the Jenkins object: 
. Likely you got confused by package names.

How do I access the setShell() method?

It should be something like that (untested):
Hopefully it helps,

On Sunday, April 15, 2018 at 10:32:45 PM UTC+2, Calvin wrote:
> I recently watched Sam's video guides 
> <https://www.youtube.com/watch?v=T1x2kCGRY1w> on how to modify Jenkins 
> settings via Groovy scripts.
> I'm trying to modify the default shell programmatically and running into 
> difficulties.
> <https://lh3.googleusercontent.com/-gHahg9EX2x4/WtOVApeTG7I/AAAAAAAA2jY/4boTZPBwJ_E83FqdzhYEPo89ZsG0SLfyQCLcBGAs/s1600/Screen%2BShot%2B2018-04-15%2Bat%2B11.07.49%2BAM.png>
> On a different Jenkins instance, I see that hudson.tasks.Shell.xml 
> contains this config
> <hudson.tasks.Shell_-DescriptorImpl>
>   <shell>bash</shell>
> </hudson.tasks.Shell_-DescriptorImpl>
> How do I access that field using Groovy?
> I found hudson.tasks.Shell.DescriptorImpl.setShell(String shell) doc 
> <http://javadoc.jenkins-ci.org/hudson/tasks/Shell.DescriptorImpl.html>.
> When I tried to access hudson.tasks via Hudson.instance.tasks.dump() I 
> got this error
> groovy.lang.MissingPropertyException: No such property: tasks for class: 
> hudson.model.Hudson
> Possible solutions: class
> 1. Jenkins.instance vs Hudson.instance? Which contains what and why?
> 2. How do I access the setShell() method?
> Thanks for your help in advance

You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to