Skip to content

JobWithDetails.getAllBuilds() throws Exception with 404 #490

Description

@WangFeiwu

My job has many builds, but I got null when call jenkinsServer.getJob("Folder1/Folder2/jobName").getAllBuilds().

Then I check the source code, and find:

List<Build> builds = client.get(path + "job/" + EncodingUtils.encode(this.getName())
                    + "?tree=allBuilds[number[*],url[*],queueId[*]]", AllBuilds.class).getAllBuilds();

The problem is this.getName(). My job's full path is :
/job/Folder1/job/Folder2/job/jobName

But this.getName() only returns jobName.

So I can get correct results with this:

List<Build> builds = client.get("/job/Folder1/job/Folder2/job/jobName"
                    + "?tree=allBuilds[number[*],url[*],queueId[*]]", AllBuilds.class).getAllBuilds();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions