I have defined a variable in jenkinsfile and it has a dynamic value, so how do i pass the value as parameter in downstream job.
main jenkinsfile
pipeline{
agent any
stages{
stage(‘Checkout stage’){
steps{
script{
name = “karan”
echo “${name}”
}
}
}
stage(‘Checking downstream job’){
steps{
build job: ‘hi job’,
parameters: [string(name: ‘FIRST_NAME’, value: ‘name’)]
}
}
}
}
downstream job
pipeline{
agent any
parameters {
string(name: ‘FIRST_NAME’, description: ‘My custom variable’)
}
stages{
stage(“first”){
steps{
script{
echo “${params.FIRST_NAME}”
echo “hello”
}
}
}
}
}
i want the output be FIRST_NAME be karan but it is showing as name