bndr / gojenkins

Jenkins API Client in Go. Looking for maintainers to move this project forward.
Apache License 2.0
870 stars 446 forks source link

Invoked BuildJob but raised "Don't have key Location in response of header" #248

Open ShenSteve opened 3 years ago

ShenSteve commented 3 years ago

using release v1.0.1, API response status code is 200 or 201, but no location in response header, the build hasn't been triggered on Jenkins. errors.New("Don't have key \"Location\" in response of header")

What kind of cause leads to this error? I mean, the response code is 200/201, but the build hasn't been triggered in fact.

lcsoft2009 commented 2 years ago

Hi @ShenSteve I got the same issue and solved by corrected my job name with the folder path(multibranch job). wrong job name: testJob correct job name: testJob/job/develop/

shreshth0707 commented 2 years ago

For a multibranch job , the name of the job should include the branch name as well Ex: Jobname : testJob Branch Name : master

jenkins.BuildJob(ctx,"testJob/job/master", nil)