gojenkins icon indicating copy to clipboard operation
gojenkins copied to clipboard

Downstream jobs not registering

Open pbarker opened this issue 9 years ago • 3 comments

The job.GetDownstreamJobs() function is not returning my downstream jobs. From looking at the api documentation in the UI, there is a jobs parameter under the primary job that has all the of the subjobs under it. It seems that parameter is not mapped into the struct. Thanks

pbarker avatar Dec 07 '16 22:12 pbarker

Will this be fixed with your #54 PR or is it unrelated?

bndr avatar Dec 08 '16 11:12 bndr

Perhaps related: I have a pipeline job which triggers other jobs, and the jenkins api does not mention the downstream jobs in the rest api for the parent, nor in the rest api for builds of the parent. So job.GetDownstreamJobs() returns no results in this case.

The actual downstream builds do refer to the parent, eg:

    {
      "_class" : "hudson.model.CauseAction",
      "causes" : [
        {
          "_class" : "hudson.model.Cause$UpstreamCause",
          "shortDescription" : "Started by upstream project \"pipeline-test\" build number 63",
          "upstreamBuild" : 63,
          "upstreamProject" : "pipeline-test",
          "upstreamUrl" : "job/pipeline-test/"
        }
      ]
    },

But I'm not sure if there's an good way to find all these links, without iterating through all builds in all projects.

mostynb avatar May 10 '17 14:05 mostynb

It seems there isn't an API to get downstream jobs directly: https://issues.jenkins.io/browse/JENKINS-33001

I also failed to get downstream jobs using job.GetDownstreamJobs(). The version of gojenkins is v1.0.1.

lobshunter avatar Dec 16 '20 18:12 lobshunter