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

Triggering jobs via CLI ignores default parameter values

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • cli, core
    • None

      I use the CLI to trigger my project that has 3 parameter:
      $ java -jar jenkins-cli.jar -s $JENKINS_SERVER build $PROJECT -p param1=a -p param2=b -p param3=c

      That works fine.
      Now, I set a default value for each parameters in the hope to not having to define each parameter on the command line:
      $ java -jar jenkins-cli.jar -s $JENKINS_SERVER build $PROJECT -p param1=a -p param3=c

      It works, but unfortunately this causes Jenkins to create a new instance of the project (aka. build) with one 2 parameters defined. The 3rd parameter (param2) which is missing on the command line is not defined. I was hoping that Jenkins would check the list of expected parameters to fill out the gaps for me.

          [JENKINS-11691] Triggering jobs via CLI ignores default parameter values

          Adam Monsen added a comment -

          Do you know about

          curl --silent --show-error http://localhost:8080/job/SingleServerApplication/buildWithParameters
          

          ?

          See http://wiki.hudson-ci.org/display/HUDSON/Parameterized+Build. You can specify just what you need to.

          Adam Monsen added a comment - Do you know about curl --silent --show-error http: //localhost:8080/job/SingleServerApplication/buildWithParameters ? See http://wiki.hudson-ci.org/display/HUDSON/Parameterized+Build . You can specify just what you need to.

          I have noticed that this is an alternative approach. Unfortunately, the bug is not solved by using this option.
          The Jenkins server ignores all undefined parameters of incoming request - not matter if the CLI or wget/curl is used. Try it

          Norman Baumann added a comment - I have noticed that this is an alternative approach. Unfortunately, the bug is not solved by using this option. The Jenkins server ignores all undefined parameters of incoming request - not matter if the CLI or wget/curl is used. Try it

          Danny Staple added a comment -

          This looks the same as the other issue. If those interested in this could add their comments to the other - it may gain more attention.

          Danny Staple added a comment - This looks the same as the other issue. If those interested in this could add their comments to the other - it may gain more attention.

            Unassigned Unassigned
            nbaumann Norman Baumann
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: