jenkinsci / jenkinsci/java-client-api
Unable to fetch build details
- Vorherrschende Sprache
- Java
- Sterne
- 913
- Forks
- 466
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Hi ! I'm currently working with Jenkins (v2.65). I want to get details from builds but I'm unable to do so. Here a sample of my code (Some checks are skipped).
Map jobs = null;
JobWithDetails jobWithDetails;
jobs = Config.jenkins.getJobs();
for (Map.Entry entry : jobs.entrySet()) {
jobWithDetails = Config.jenkins.getJob(entry.getKey());
if (jobWithDetails != null) {
List list = null;
BuildWithDetails buildWithDetails = null;
list = jobWithDetails.getAllBuilds();
for (Build build : list) {
Build tmp_b = jobWithDetails.getBuildByNumber(build.getNumber());
buildWithDetails = tmp_b.details();
if (buildWithDetails != null)
// Do something....
else
System.out.println("Cannot retrieved 'BuildWithDetails'.");
}
}
}
> `Config.jenkins` is nothing more than a `JenkinsServer` instance.
I do mostly the same as @khmarbaise on issue #138 but `buildWithDetails` keep being equal to null.
Here a screenshot to illustrate :

Notice that I have to use `jobWithDetails = Config.jenkins.getJob(entry.getKey());` to get a valid `JobWithDetail` instance.
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.