I am using following declarative pipeline code to trigger other Jenkins pipeline job as Upstream , but its not working.
pipeline {
agent { label 'node1' }
parameters {
string(defaultValue: "${env.VAR1_BUILD}", description: 'Choose_version', name: 'BUILD_ID')
string(defaultValue: "docker_1", description: 'Build_Host', name: 'NODE')
string(defaultValue: "test_scrip", description: 'Checkout Branch ', name: 'SCRIPT_BRANCH_NAME')
string(defaultValue: "test1@gmail.com", description: 'Notification', name: 'MAIL')
choice(choices: 'PIPELINEC', description: 'Release'Name, name: 'JOB_NAME')
choice(choices: 'branch1', description: 'Select Release Branch', name: 'CHECKOUT_BRANCH_NAME')
choice(choices: '.zip', description: 'Select tar ball', name: 'EXT')
}
stages{
stage ('Invoke_PipelineA'){
steps{
build job: 'PipelineA',
parameters: [string(name: 'BUILD_ID', value: '"${env._BUILD}"'),
string(name: 'NODE', value: '"${params.NODE}"'),
string(name: 'SCRIPT_BRANCH_NAME', value: '"${params.SCRIPT_BRANCH_NAME}"'),
string(name: 'MAIL', value: '"${params.MAIL}"'),
choice(choices: '"${params.JOB_NAME}"', name: 'JOB_NAME'),
choice(choices: '"${params.CHECKOUT_BRANCH_NAME}"', name: 'CHECKOUT_BRANCH_NAME'),
choice(choices: '$"{params.EXT}"', name: 'EXT')]
}
}
}
Please suggest whether syntax is correct or not