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

DynamicReferenceParameter doesn't generate html when from pipeline script.

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      A multibranch Pipeline with Jenkins pipeline script.

      After Running build and opening Build With parameters page,  the bellow falls to fallbackScript

       

      this is my code:

      (one note, if I add via Jenkins UI (Configure-> Add parameter -> Active Choice sReactive Reference Parameter ->  put script there, it works fine. but not from pipeline script.)

      stage ('Parameters'){
        steps {
         script {
          properties([                                                              
           parameters([         	       
            [$class: 'DynamicReferenceParameter',
                     choiceType: 'ET_FORMATTED_HTML',	                                    
      	             name: 'TYPE',                                    
      	                                   
      	             script: [
      	             $class: 'GroovyScript',
      	             fallbackScript: [
      	             classpath: [],
      	             sandbox: false,
      	             script: '''
                           return """
                             <p>FallbackScript. Error in main script</p>
                           """ 
                           '''
      	             ],
      				 script: [
      				classpath: [],
      				sandbox: false,
      				script: '''
      				return """
      <head>
         <script>
            function foo(val){		
              alert(val.value);      
            }
         </script>
      </head>
      
         <select  onchange='foo(this);'>
            <option value='X'>X</option>
            <option value='Y'>Y</option>
         </select>
      
      				  """    
      				'''
      			]
      	    ]
           ]) 
          ])
         }
        }
      } 	
      	....		
      
      
      

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            yevsh yev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: