Thanks,

That was my fix -- I went to that screen under Manage Jenkins and set those 
calls to be allowed in the sandbox.  

Thanks for the help.

Cheers,
Greg



On Friday, July 8, 2016 at 11:20:27 AM UTC-4, Baptiste Mathus wrote:
>
> Probably you simply want to allow that finding call.
> Open the /scriptApproval screen for that purpose.
>
> Depending on what you're trying to do. Maybe using long start = 
> System.currentTimeMillis() would suit your needs and be already whitelisted 
> (can't check just now).
>
> HTH
> Le 7 juil. 2016 9:51 PM, "Greg Smith" <[email protected] <javascript:>> 
> a écrit :
>
>>
>> Hi,
>>
>> I would like to set a timestamp at the beginning of my pipeline build, 
>> put it into the environment, and reuse it throughout my build.  
>>
>> I found some sample code - but it no longer seems to work because of 
>> sandboxing of the groovy pipeline scripts.
>>
>> The code is:
>> env.TIMESTAMP = new 
>> java.text.SimpleDateFormat('yyyyMMddHHmmss').format(new Date())
>>
>> But I get this error now:
>>
>> org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: 
>> Scripts not permitted to use new java.text.SimpleDateFormat java.lang.String
>>      at 
>> org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectNew(StaticWhitelist.java:185)
>>
>> How should I be setting a timestamp value that I can reuse over throughout 
>> the rest of my build?
>>
>> Thanks,
>> Greg
>>
>>
>> -- 
>> 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] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/fae69470-a517-4167-a9fb-655170f92084%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/fae69470-a517-4167-a9fb-655170f92084%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/2a85bd7e-f073-481f-bf2b-aab850d915a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to