I have just upgraded the jenkins version and wrote my first Jenkins declarative plugin. Following is the pipeline definition

pipeline {
    agent any
                sh '''
                echo "Hello"

On building the job, it is generating the following error:

java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowRun cannot be cast to hudson.model.AbstractBuild
at hudson.plugins.zentimestamp.ZenTimestampEnvironmentContributor.buildEnvironmentFor(ZenTimestampEnvironmentContributor.java:23)

Can anyone provide me with a solution ? I understand that it may be a very noob question to ask but I am stuck on this for hours.

Is it a versioning issue? ZenTimestamp is a project which is up for adoption. Is this a bug related to it ?

  • This might depend on the main jenkins configuration. Perhaps the configuration of this plugin is incomplete? the docs say " You must specify a java.text.SimpleDateFormat pattern such as the value 'yyyyMMddHHmmss'." - is a format specified? – Bruce Becker Nov 17 '20 at 7:59
  • yes, the format is specified in global properties. – Subrata Das Nov 17 '20 at 9:22
  • One thing, in global settings, BUILD_TIMESTAMP is being referred to as BUILD_ID variable. Can this create any issue? issues.jenkins.io/browse/JENKINS-26520 – Subrata Das Nov 17 '20 at 9:29
  • 1
    Also posted at unix.stackexchange.com/questions/620041/… – Jeff Schaller Nov 18 '20 at 12:44
  • I was not aware that cross posting is discouraged. I have deleted the question from unix.stackexchange. – Subrata Das Nov 18 '20 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.