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

This issue is archived. You can view it, but you can't modify it. Learn more

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
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: