Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-64283

Not able to set password parameter's default value from shared library

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • workflow-cps-plugin
    • None

      When setting a default value for a password parameter from shared library code, we get the warning "Unknown parameter(s) found for class type 'hudson.model.PasswordParameterDefinition': defaultValue" in the build log .

      As an example, the Jenkinsfile: 

      #!/usr/bin/env groovy @Library('<git-branch-name>')_ 
      passwordUse()
      

      shared library, vars/passwordUse.groovy: 

      def call() {
          stage('Show parameters') {
              echo "test_password : " + params.test_password
          }
          stage('Add password parameter') {
              properties([
                      parameters([
                              password(name: 'test_password', defaultValue: 'default_password', description: 'test password')
                      ])
              ])
          }
      }
      

      The warning in the build log: 

      [Pipeline] stage
      [Pipeline] { (Add password parameter)
      [Pipeline] properties (hide)
      WARNING: Unknown parameter(s) found for class type 'hudson.model.PasswordParameterDefinition': defaultValue
      [Pipeline] }
      [Pipeline] // stage
      

            Unassigned Unassigned
            kship Konstantin Shipkov
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: