Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JobWithDetails.getAllBuilds() throws Exception with 404 #490

Open
WangFeiwu opened this issue Sep 16, 2021 · 2 comments
Open

JobWithDetails.getAllBuilds() throws Exception with 404 #490

WangFeiwu opened this issue Sep 16, 2021 · 2 comments
Labels

Comments

@WangFeiwu
Copy link

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();
@WangFeiwu WangFeiwu added the bug label Sep 16, 2021
@Volcanolcc
Copy link

I have the same problem, do you have any good solution?

@Natsukashiiteja
Copy link

Natsukashiiteja commented Sep 10, 2023

we can define our current jobs path in a static or a final variable before instantiating the this.getName().
Once try this approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants