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

Job DSL Can not generate ParameterizedRemoteTrigger parameters correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • job-dsl-plugin
    • None

      Hello,

      I am using Jenkins Jenkins 2.346.2

      Job DSL Version: 1.81 
      Parameterized Remote Trigger Plugin Version: 3.1.6.3 
       
      When I generate a Job DSL with following snippet as described in JobDSL documentation:
      https://jenkinsci.github.io/job-dsl-plugin/#method/javaposse.jobdsl.dsl.helpers.step.StepContext.remoteTrigger

      steps {
        remoteTrigger(signJenkinsInstanceName, signJenkinsRemoteJobName) {
          parameter('artifactId', 'test')
          parameter('classifier', 'win64')
          parameter('extension', 'exe')
          parameter('version', '$releaseVersion')
        }
      }

      On the config.xml I get the following generated XML:

      <parameters>artifactId=test
      classifier=win64
      extension=exe
      version=$releaseVersion</parameters>
      <parameterList>
         <string>artifactId=test</string>
          <string>classifier=win64</string>
          <string>extension=exe</string>
          <string>version=$releaseVersion</string>
      </parameterList> 

      However on the GUI none of the parameters are shown and Job and Job execution fails.
       
      If I configure the Job on the GUI, I see that a new "mapParameter" type is introduced and it is recommended. If I use this mapParameter to configure the same set of parameters on the config.xml I get:

      <parameters2 class="org.jenkinsci.plugins.ParameterizedRemoteTrigger.parameters2.MapParameters">
        <parameters>
          <org.jenkinsci.plugins.ParameterizedRemoteTrigger.parameters2.MapParameter>
            <name>artifactId</name>
            <value>test</value>          
          </org.jenkinsci.plugins.ParameterizedRemoteTrigger.parameters2.MapParameter>
          <org.jenkinsci.plugins.ParameterizedRemoteTrigger.parameters2.MapParameter>
            <name>classifier</name>
            <value>win64</value>
          </org.jenkinsci.plugins.ParameterizedRemoteTrigger.parameters2.MapParameter>
          <org.jenkinsci.plugins.ParameterizedRemoteTrigger.parameters2.MapParameter>
            <name>extension</name>
            <value>exe</value>
          </org.jenkinsci.plugins.ParameterizedRemoteTrigger.parameters2.MapParameter>
          <org.jenkinsci.plugins.ParameterizedRemoteTrigger.parameters2.MapParameter>
            <name>version</name>
            <value>$releaseVersion</value>
          </org.jenkinsci.plugins.ParameterizedRemoteTrigger.parameters2.MapParameter>
        </parameters>
      </parameters2>
      

      By this configuration done over GUI it works but with the generated configuration Job does not work.

      I guess the old sting based parameters are removed from Parameterized Remote Trigger Plugin.

            jamietanna Jamie Tanna
            mcancomert Mehmet Can
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: