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

ActiveChoice Plugin cannot be defined in Jenkinsfile

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      (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

        Attachments

          Activity

          Hide
          kinow Bruno P. Kinoshita added a comment -

          Replied in SO. Marking the ticket as Not a Bug, but please be aware that there are other issues here in Jira to propertly implement support for pipelines in the plug-in. The active choices parameters that reference other parameters resolve the dependency between elements visually, via the HTML DOM. Running them with pipelines will result in no dependency at all, as we can't find objects, as there's no DOM (i.e. the reactive part is still built on top of JavaScript, but I plan to add a Java layer, to support pipelines too).

           

          Hope that helps

          Bruno

          Show
          kinow Bruno P. Kinoshita added a comment - Replied in SO. Marking the ticket as Not a Bug, but please be aware that there are other issues here in Jira to propertly implement support for pipelines in the plug-in. The active choices parameters that reference other parameters resolve the dependency between elements visually, via the HTML DOM. Running them with pipelines will result in no dependency at all, as we can't find objects, as there's no DOM (i.e. the reactive part is still built on top of JavaScript, but I plan to add a Java layer, to support pipelines too).   Hope that helps Bruno

            People

            • Assignee:
              kinow Bruno P. Kinoshita
              Reporter:
              mrmunch Steffen Becker
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: