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

Reactive Reference parameter with Formated HTML loses script section when binding to other build parameters

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • active-choices-plugin
    • None
    • Jenkins 2.32.2, Active Choices 1.5.2, Chrome v. 56

      Using an Active Choices Reactive Reference Parameter and having it return Formatted HTML with a script portion (onchange, etc...) works great unless the groovy script references other dependent build parameters such as strings, Active Choice parameters, etc... The returned HTML renders properly, just without the script. Attached is a (hopefully) very simple job configuration to demonstrate.

      The groovy script for generating the sample test is as follows (DummyVar is a string parameter defined just above this parameter):

      //Uncomment this line, causing DummyVar to be referenced, and the script will be lost at runtime.
      //def a = DummyVar
      
      def FullHTML = ""
      FullHTML += "<head>"
      FullHTML += "<script type='text/javascript'> jQuery(document).on('ready', function() {	function updateOutputValue()  { jQuery('#value').val('Booya!');     };"
      FullHTML += " updateOutputValue();"
      FullHTML += "});"
      FullHTML += "</script>"
      FullHTML += "</head>"
      FullHTML += "<body><form><input id='value' name='value' > </form></body>"
      return FullHTML
      

        1. screenshot-1.png
          screenshot-1.png
          12 kB
        2. image-2017-06-01-22-48-32-552.png
          image-2017-06-01-22-48-32-552.png
          13 kB
        3. image-2017-06-01-22-46-45-391.png
          image-2017-06-01-22-46-45-391.png
          11 kB
        4. config-doubleload.xml
          7 kB
        5. config-5-4-2017.xml
          8 kB
        6. config[1].xml
          5 kB
        7. config.xml
          4 kB
        8. config.xml
          4 kB

            ioannis Ioannis Moutsatsos
            bmatzen Bill Matzen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: