diff --git a/src/main/java/hudson/plugins/global_build_stats/JobBuildResultFactory.java b/src/main/java/hudson/plugins/global_build_stats/JobBuildResultFactory.java index 8244bd3..aecb626 100644 --- a/src/main/java/hudson/plugins/global_build_stats/JobBuildResultFactory.java +++ b/src/main/java/hudson/plugins/global_build_stats/JobBuildResultFactory.java @@ -36,11 +36,13 @@ public JobBuildSearchResult createJobBuildSearchResult(Run build){ public JobBuildSearchResult createJobBuildSearchResult(JobBuildResult r){ boolean isJobAccessible = false; boolean isBuildAccessible = false; + String jobUrl = ""; Job targetJob = ((Job) Jenkins.getInstance().getItemByFullName(r.getJobName())); // Link to job will be provided only if job has not been deleted/renamed if(targetJob != null){ isJobAccessible = true; + jobUrl = targetJob.getUrl(); if(targetJob.getBuildByNumber(r.getBuildNumber()) != null){ // Link to build infos will be provided only if build result has not been purged // @see issue #7240 @@ -48,7 +50,7 @@ public JobBuildSearchResult createJobBuildSearchResult(JobBuildResult r){ } } - return new JobBuildSearchResult(r, isJobAccessible, isBuildAccessible); + return new JobBuildSearchResult(r, isJobAccessible, isBuildAccessible, jobUrl); } public static String extractUserNameIn(Run build){ diff --git a/src/main/java/hudson/plugins/global_build_stats/model/JobBuildSearchResult.java b/src/main/java/hudson/plugins/global_build_stats/model/JobBuildSearchResult.java index f901745..b76a63c 100644 --- a/src/main/java/hudson/plugins/global_build_stats/model/JobBuildSearchResult.java +++ b/src/main/java/hudson/plugins/global_build_stats/model/JobBuildSearchResult.java @@ -14,12 +14,14 @@ public class JobBuildSearchResult extends JobBuildResult { private boolean jobAccessible; // Will be true if isJobAccessible is true AND build result has not been deleted private boolean buildAccessible; + private String jobUrl; - public JobBuildSearchResult(JobBuildResult decoree, boolean isJobAccessible, boolean isBuildAccessible){ + public JobBuildSearchResult(JobBuildResult decoree, boolean isJobAccessible, boolean isBuildAccessible, String jobUrl) { super(decoree.getResult(), decoree.getJobName(), decoree.getBuildNumber(), decoree.getBuildDate(), decoree.getDuration(), decoree.getNodeName(), decoree.getUserName()); this.jobAccessible = isJobAccessible; this.buildAccessible = isBuildAccessible; + this.jobUrl = jobUrl; } public boolean isJobAccessible() { @@ -33,4 +35,8 @@ public boolean isBuildAccessible() { public String getDurationString(){ return Util.getTimeSpanString(getDuration()); } + + public String getJobUrl() { + return jobUrl; + } } diff --git a/src/main/resources/hudson/plugins/global_build_stats/GlobalBuildStatsPlugin/buildHistory.jelly b/src/main/resources/hudson/plugins/global_build_stats/GlobalBuildStatsPlugin/buildHistory.jelly index a3cb8da..f0ea5e3 100644 --- a/src/main/resources/hudson/plugins/global_build_stats/GlobalBuildStatsPlugin/buildHistory.jelly +++ b/src/main/resources/hudson/plugins/global_build_stats/GlobalBuildStatsPlugin/buildHistory.jelly @@ -216,7 +216,7 @@ - ${jobResult.jobName} + ${jobResult.jobName} ${jobResult.jobName} @@ -226,8 +226,8 @@ -
- #${jobResult.buildNumber} +
+ #${jobResult.buildNumber}
#${jobResult.buildNumber} @@ -237,7 +237,7 @@ - +