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

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

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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
      

        Attachments

          Activity

          There are no comments yet on this issue.

            People

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

              Dates

              Created:
              Updated: