I upgraded my jenkins recently from 2.164.3 to 2.249.3 version and also upgraded the build pipeline plugin in addition to many other plugins.
and since than my E2E pipe broke on parameters that are passed to downstran job from upstream job.
whay my pipeline does is something like that:
UpstreamJob
stage('Job_1') {
stage('Create') {
steps {
//whatever the job_1 does
}
}
}
stage('Job_2'){
steps {
script {
try {
create_cluster_build_id = Job_1.getId()
} catch (err) {
println "No id was found"
}
down_stream_job_2 = build job: 'Job_2', wait: true, propagate: true, parameters: [
[$class: 'StringParameterValue', name: 'Branch', value: branch_Name],
[$class: 'StringParameterValue', name: 'Docker_Tag', value: docker_tag],
[$class: 'StringParameterValue', name: 'upstream_name', value: env.JOB_NAME],
[$class: 'StringParameterValue', name: 'upstream_build_id', value: env.BUILD_NUMBER],
[$class: 'StringParameterValue', name: 'upstream_build_url', value: env.BUILD_URL],
[$class: 'StringParameterValue', name: 'Job_1_id', value: Job_1_id],
]
}
}
and the error I get inside job2 is
groovy.lang.MissingPropertyException: No such property: Job1_id for class: groovy.lang.Binding
Now... 1)Iv'e found a documentation for similar issue - JENKINS-34871
2)as WA I tried to add the parameter manually in the job2 configuration (in old jenkins configuration it was not part of the job parameters) , it worked but... after several runs the parameter was gone again although I saved it in the job2 configuration.
So my question to the jenkins experts outthere are:
How can it be that I add parameter to a job, save and apply, and after few runs it (the parameter) dissappears?