title: Problem with passing parameters to Jenkins build using Jenkins Job Builder
body: <p>I want to pass custom parameters to my Jenkins builds using <a href="https://jenkins-job-builder.readthedocs.io/en/latest/index.html" rel="nofollow noreferrer">Jenkins Job Builder</a>.</p>
  <p><strong>My current job definition YAML file and configuration file look like this:</strong></p>
  <p><code>deploy.yaml</code></p>
  <pre><code>- job:
      name: 'TestJobName'
      display-name: 'TestJobName'
      description: 'TestJobName multibranch job'
      folder: TestFolder
      script-path: Jenkinsfile
      project-type: multibranch
      disabled: false
      scm:
        - git:
            url: '&lt;my_private_repo_link&gt;'
            credentials-id: github
            submodule:
              disable: false
              recursive: true
              parent-credentials: true
            discover-branches: true
            ignore-on-push-notifications: false
            discover-tags: false
            build-strategies:
              - skip-initial-build: true
            clean:
              after: true
              before: true
            prune: true
            shallow-clone: true
            use-author: true
            wipe-workspace: true
            property-strategies:
              all-branches:
                  - suppress-scm-triggering: true
  </code></pre>
  <p><code>jenkins_jobs.ini</code></p>
  <pre><code>[job_builder]
  ignore_cache=True
  keep_descriptions=False
  include_path=.:scripts:~/git/
  recursive=False
  exclude=.*:manual:./development
  allow_duplicates=False
  update=all
  
  [jenkins]
  user=&lt;my_username&gt;
  password=&lt;my_password&gt;
  url=http://localhost:8080
  query_plugins_info=False
  </code></pre>
  <p><strong>And it works perfectly fine:</strong></p>
  <p><code>$ jenkins-jobs --conf jenkins_jobs.ini update deploy.yaml</code></p>
  <pre><code>INFO:jenkins_jobs.cli.subcommand.update:Updating jobs in ['deploy.yaml'] ([])
  INFO:jenkins_jobs.builder:Number of jobs generated:  1
  INFO:jenkins_jobs.builder:Creating jenkins job TestFolder/TestJobName
  INFO:jenkins_jobs.cli.subcommand.update:Number of jobs updated: 1
  INFO:jenkins_jobs.builder:Number of views generated:  0
  INFO:jenkins_jobs.cli.subcommand.update:Number of views updated: 0
  </code></pre>
  <p><strong>However, if i add <em>parameters</em> block right from <a href="https://jenkins-job-builder.readthedocs.io/en/latest/parameters.html" rel="nofollow noreferrer">documentation</a>:</strong></p>
  <pre><code>  parameters:
      - string:
          name: FOO
          default: bar
          description: &quot;A parameter named FOO, defaults to 'bar'.&quot;
  </code></pre>
  <p><strong>I get this:</strong></p>
  <p><a href="https://i.stack.imgur.com/3k59u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3k59u.png" alt="enter image description here" /></a></p>
  <p><strong>With this error message:</strong></p>
  <pre><code>jenkins.JenkinsException: Error in request. Possibly authentication failed [500]: Server Error
  </code></pre>
  <p><strong>In Jenkins logs i can see more explanatory error message:</strong></p>
  <pre><code>WARNING h.i.i.InstallUncaughtExceptionHandler#handleException: Caught unhandled exception with ID 38c914db-978c-469f-87a5-b12cb707efc2
  java.lang.ClassCastException: hudson.model.ParametersDefinitionProperty cannot be cast to com.cloudbees.hudson.plugins.folder.AbstractFolderProperty
          at com.cloudbees.hudson.plugins.folder.AbstractFolder.getOverrides(AbstractFolder.java:678)
          at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
          at org.kohsuke.stapler.Stapler.invoke(Stapler.java:898)
          at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:281)
          at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
          at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766)
          at org.kohsuke.stapler.Stapler.invoke(Stapler.java:898)
          at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:281)
          at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
          at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766)
          at org.kohsuke.stapler.Stapler.invoke(Stapler.java:898)
          at org.kohsuke.stapler.Stapler.invoke(Stapler.java:694)
          at org.kohsuke.stapler.Stapler.service(Stapler.java:240)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
          at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:763)
          at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1633)
          at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
          at jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:129)
          at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
          at jenkins.security.ResourceDomainFilter.doFilter(ResourceDomainFilter.java:76)
          at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
          at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
          at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
          at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1609)
          at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:159)
          at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
          at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1609)
          at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
          at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
          at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
          at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
          at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
          at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
          at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
          at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
          at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
          at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
          at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
          at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
          at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
          at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
          at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
          at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
          at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)
          at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
          at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
          at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1609)
          at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:51)
          at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
          at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1609)
          at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
          at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
          at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1609)
          at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
          at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
          at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1609)
          at jenkins.security.SuspiciousRequestFilter.doFilter(SuspiciousRequestFilter.java:36)
          at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
          at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1609)
          at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:561)
          at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
          at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:578)
          at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
          at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
          at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1612)
          at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
          at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)
          at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
          at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
          at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1582)
          at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
          at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
          at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
          at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
          at org.eclipse.jetty.server.Server.handle(Server.java:516)
          at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
          at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:556)
          at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
          at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
          at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
          at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
          at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
          at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
          at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
          at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
          at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
          at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
          at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:773)
          at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:905)
          at java.lang.Thread.run(Thread.java:748)
  
  </code></pre>
  <p>Looking for ideas on how to overcome this issue.</p>