Closed ux123 closed 3 years ago
@ux123 tweaked your samples a bit to test from my environment, but was able to recreate the error.
Could you try updating this line in initialize.groovy:
pipelineConfig.changedItems.add("${mItem}")
to:
pipelineConfig.changedItems.add("${mItem}".toString())
I think that's the GString causing the error.
I recommend returning your own object/hash from initialize(...)
and using that instead of adding things to pipelineConfig.
@ux123 tweaked your samples a bit to test from my environment, but was able to recreate the error.
Could you try updating this line in initialize.groovy:
pipelineConfig.changedItems.add("${mItem}")
to:pipelineConfig.changedItems.add("${mItem}".toString())
I think that's the GString causing the error.
Thanks! I needed to append .toString()
to a different variable in the initialize.groovy that was assigned {BUILD_NUMBER}
. Doing pipelineConfig.buildNumber = "${BUILD_NUMBER}".toString()
fixed the issue for me. Thanks so much for your help.
Jenkins Version
Jenkins 2.235.1
JTE Version
2.2.2
Bug Description
When trying to write to currentBuild.description in the pipeline template, the build fails with the error
Failed to serialize hudson.model.Actionable#Actions for class org.jenkinsci.plugins.workflow.job.WorkflowRun
. Doing the same in an initialize library doesn't result in a failure. Also, before moving any of the pipeline code into JTE libraries, we were able to write to the currentBuild variable successfully in the Jenkinsfile.Relevant log output
Steps to Reproduce
Pipeline template
initialize.groovy
clean_item.groovy