gojenkins
gojenkins copied to clipboard
copy job is 500 error
client := gojenkins.CreateJenkins(nil, "http://192.168.xx.xx:8080", "admin", "admin") client .Init()
The client of jekins is normal, it is can getJob and is normal, but when i invaoke CopyJob is 500 err
client .CopyJob(jobName, newJobName) is 500 err, why?
@205043957 Could you provide the detail error log?
You can also first get the job, and then copy it. Like the example in test case:
func TestCopyDeleteJob(t *testing.T) {
job, _ := jenkins.GetJob("Job1_test")
jobCopy, _ := job.Copy("Job1_test_copy")
assert.Equal(t, jobCopy.GetName(), "Job1_test_copy")
jobDelete, _ := job.Delete()
assert.Equal(t, true, jobDelete)
}