I want to get Getting current timestamp in inline pipeline script using pipeline plugin of hudson. For setting up build display name.
Inline groovy script used:
Jenkins scripts are running in a sandbox, by default the Groovy script doesn't have permissions for some operations.
When you perform an operation without permissions the RejectAccessException is thrown. So you've to execute your script, and then when the exception is thrown go to:
http://yourHost/jenkins/scriptApproval/
And approve the necessary permission: