HI Colin,

this groovy is updating/adding build perodic section in build triggers 
section.

can you please share the script to update poll scm section in build triger 
section via groovy script.

Regards,
Raju.


On Wednesday, October 29, 2014 at 2:27:47 PM UTC+5:30, Colin McIntyre wrote:
>
> Old post, I know, but I just came across this issue so thought I'd add my 
>> findings.  https://issues.jenkins-ci.org/browse/JENKINS-14771 looks to 
>> be the same issue, the reason for the NPE is that while you've added the 
>> trigger to the job you haven't told the trigger about the job.  To work 
>> around it I used this code:
>>
>
> def job = hudson.model.Hudson.instance.getJob("My Job");
> def spec = "0 0 1 * *";
> hudson.triggers.TimerTrigger newCron = new 
> hudson.triggers.TimerTrigger(spec);
> newCron.start(job, true);
> job.addTrigger(newCron);
> job.save(); 
>
> It's the call to TimerTrigger.start that sorted it for me.
>
>
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8e179ac5-a7ea-44ae-b0b8-3fef0fda9ec6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to