I think you can have a "build" variable (https://jenkins.io/doc/pipeline/tour/environment/), or parameter (below), and use the value assigned to that.
Using parameters in a Jenkinsfile. When this runs you will get an interactive window. pipeline { agent any parameters { string(name: 'Stack', defaultValue: 'Production', description: 'Which environment is this for?') } stages { stage('Build') { steps { echo "Running BuilId [${env.BUILD_ID}] on JenkinsUrl [${env.JENKINS_URL}] for Job [${env.JOB_NAME}]" // sh "<something> <something> ${params.Stack} buildIt" -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a5dbe640-eaab-48c2-8a52-1d24135a8b08%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.