want to get the previous build value in defaultValue. Don't want to hardcode value.Don't wnt to use plugin for this.

XMLWordPrintable

      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

      { echo "non-prod " }

      }}}

            Assignee:
            Ivan Sugonyak
            Reporter:
            umair
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: