-
Task
-
Resolution: Not A Defect
-
Blocker
-
None
want to get the previous build value in defaultValue. Don't want to hardcode value.Don't wnt to use plugin for this.
==========================================
def Account_ID
pipeline {
agent any
options
{ buildDiscarder(logRotator(numToKeepStr: '7')) } parameters {(
string(defaultValue: "${Account_ID}" ,name: 'env', description: 'Enter environment.'))}
stage('Prod Build') {
when {
expression{"${Account_ID}" == 'prod'}
}
steps {
echo "prod"
}}
stage('Non-Prod Build') {
when {
expression{"${Account_ID}" == 'non'}
}
steps
}}}