I want to archive a specific JSON file that's name depends on the parameter passed in build, but I get the error
WorkflowScript: 42: unexpected char: '`'
what's the correct way to go about this?
archiveArtifacts artifacts: `closureV2_${params.env.split('/')[3]}.json`, onlyIfSuccessful: false
Would .split('/')[3] even work in a jenkinsfile?
For Jenkinsfile which uses Groovy as program language, Groovy not use ` for string expression.
Please change to
"closureV2_${params.env.split('/')[3]}.json"