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:
def jobName = env.JOB_NAME + "_" + new Date()
currentBuild.displayName = "$jobName"
node {
echo "job name $jobName"
}
Error on console :
org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException:
Scripts not permitted to use new java.util.Date