We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Jenkins version: Jenkins 2.277.1 Dependency Version: 0.3.8
I tried to get an old job number using getBuildByNumber():
getBuildByNumber()
Build build = jenkins.getJob(deployServicesJob).getBuildByNumber(buildNumber); BuildWithDetails buildWithDetails = build.details();
Calling build.details(); throws: java.lang.NullPointerException: Cannot invoke "com.offbytwo.jenkins.model.Build.details()" because "build" is null
build.details();
java.lang.NullPointerException: Cannot invoke "com.offbytwo.jenkins.model.Build.details()" because "build" is null
The job has 200+ builds, which I suspect may be the problem if Jenkins only returns at most 100 jobs.
The build is accessible using getAllBuilds() so my workaround is to use that method instead:
getAllBuilds()
List<Build> allBuilds = jenkins.getJob(deployServicesJob).getAllBuilds(); Optional<Build> optional = allBuilds.stream().filter(b -> b.getNumber() == buildNumber).findFirst(); if (optional.isEmpty()) { throw new IllegalArgumentException("Build not found"); } Build build = optional.get();
The text was updated successfully, but these errors were encountered:
maybe you can try use my repo that fork the master branch,i fix that bug
Sorry, something went wrong.
is this issue fixed? i'm facing the same issue..
maybe you can see i forked repo
hey , is anyone working on this issue?
No branches or pull requests
Jenkins version: Jenkins 2.277.1
Dependency Version: 0.3.8
I tried to get an old job number using
getBuildByNumber()
:Calling
build.details();
throws:java.lang.NullPointerException: Cannot invoke "com.offbytwo.jenkins.model.Build.details()" because "build" is null
The job has 200+ builds, which I suspect may be the problem if Jenkins only returns at most 100 jobs.
The build is accessible using
getAllBuilds()
so my workaround is to use that method instead:The text was updated successfully, but these errors were encountered: