When a job is residing in a folderJob then the API url to the job in job.allBuilds() points to /job/SIMPLE_JOB_NAME/api/json which causes a 404. Instead the job.allBuilds() should point to /job/FOLDER_JOB_NAME/job/SIMPLE_JOB_NAME/api/json.
When a job is residing in a folderJob then the API url to the job in job.allBuilds() points to /job/SIMPLE_JOB_NAME/api/json which causes a 404. Instead the job.allBuilds() should point to /job/FOLDER_JOB_NAME/job/SIMPLE_JOB_NAME/api/json.
if (builds == null) { return Collections.emptyList(); } else { return transform(builds, new Function<Build, Build>() { @Override public Build apply(Build from) { return buildWithClient(from); } }); } } catch (HttpResponseException e) { // TODO: Thinks about a better handling if the job does not exist? if (e.getStatusCode() == HttpStatus.SC_NOT_FOUND) { // TODO: Check this if this is necessary or a good idea? return null; } throw e; } }