jenkins-zh / jenkins-cli

Jenkins CLI allows you to manage your Jenkins in an easy way. Jenkins 命令行客户端
http://www.jenkins-zh.cn/jenkins-cli/
MIT License
389 stars 78 forks source link

edit and build fails with 400 error #667

Open natsen opened 2 years ago

natsen commented 2 years ago

Describe the bug jcli job edit -b "mutibranch-job branch" -f mypipeline.groovy fails with 400 error. To Reproduce Steps to reproduce the behavior:

  1. Create a multibranch job that sources jenkinsfile from scm
  2. Run the job
  3. edit and run the job jcli job edit -b "mutibranch-job branch" -f mypipeline.groovy
  4. Returns 400 error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots {"level":"debug","message":"HTTP request as curl","cmd":"curl -X 'POST' -H 'Authorization: Basic ==' -H 'Jenkins-Crumb: ' -H 'User-Agent: jcli; 0.0.38; a99158f' 'http://jenkins/build'"} {"level":"debug","message":"get response","data":"\n\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"/>\nError 400 Nothing is submitted\n\n

HTTP ERROR 400 Nothing is submitted

\n\n\n\n\n\n
URI:/jenkins//build
STATUS:400
MESSAGE:Nothing is submitted
SERVLET:Stapler
\n
<a href=\"https://eclipse.org/jetty\">Powered by Jetty:// 9.4.39.v20210325
\n\n\n\n"} Error: bad request, code 400

Desktop (please complete the following information):

Additional context This might be happening only for the parameterized job. job edit with -b option did not ask for parameters. debug log shows it attempted to build the job (without parameters)