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

ActiveChoice Plugin cannot be defined in Jenkinsfile

XMLWordPrintable

      (I already created a StackOverflow post but no anser after several days so I hope I have more luck here)

      When I try to define a DynamicReferenceParameter within a Jenkinsfile, I get an error. My Jenkinsfile looks like this:

      properties([parameters([
          [
              $class: 'DynamicReferenceParameter',
              name: 'TEST',
              script: [
                  $class: 'GroovyScript', 
                  fallbackScript: '', 
                  script: """
                      def html =
                      '''
                      <!DOCTYPE html>
                      <html>
                      <body>
      
                      <table id="serviceTable">
                          <tr>
                          <td><input type="checkbox" id="checkbox">service1</td>
                          <td><div id="version" >version: <input type="text"></div></td>
                          </tr>
      
                      </table>
                      </body>
                      </html>
                      '''
                      return html
                  """
              ]
          ]
      ])])
      

      I get this error:

      java.lang.ClassCastException: org.biouno.unochoice.model.GroovyScript.script expects class org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript but received class java.lang.String

            kinow Bruno P. Kinoshita
            mrmunch Steffen Becker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: