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

pipelineJob does not support trim option for stringParam

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • job-dsl-plugin
    • None

      context

      I am trying to define a string parameter with a trim option set to true in a pipelineJob (inspired from syntax of implementation done in JENKINS-47115).

       

       

      pipelineJob {
        ...
        parameters {
          stringParam('OWNER', 'team1', 'Team', true)
          
        }
        ...
      }

       

      When I run the job, I got a job failure :

       

      Processing DSL script jenkins-jobs/main_jobdsl.groovy
      (main_jobdsl.groovy, line 88) No signature of method: javaposse.jobdsl.dsl.helpers.BuildParametersContext.stringParam() is applicable for argument types: (java.lang.String, java.lang.String, java.lang.String, java.lang.Boolean) values: [OWNER, team1, Team, ...]
      
      Possible solutions: stringParam(java.lang.String, java.lang.String, java.lang.String), stringParam(java.lang.String, java.lang.String), stringParam(java.lang.String), runParam(java.lang.String, java.lang.String, java.lang.String), runParam(java.lang.String, java.lang.String, java.lang.String, java.lang.String).

       

      looking at the code of the BuildParametersContext, I see the trim option is not managed in the method stringParam.

       

      created PR : https://github.com/jenkinsci/job-dsl-plugin/pull/1169

       

       

            daspilker Daniel Spilker
            jphautin2 Jean-Philippe HAUTIN
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: