diff --git a/plugin/src/main/java/io/jenkins/plugins/analysis/core/model/SummaryModel.java b/plugin/src/main/java/io/jenkins/plugins/analysis/core/model/SummaryModel.java
index aefe320383..f60ead4a7a 100644
--- a/plugin/src/main/java/io/jenkins/plugins/analysis/core/model/SummaryModel.java
+++ b/plugin/src/main/java/io/jenkins/plugins/analysis/core/model/SummaryModel.java
@@ -10,6 +10,7 @@
import hudson.model.Run;
+import io.jenkins.plugins.forensics.reference.ReferenceBuild;
import io.jenkins.plugins.util.QualityGateStatus;
/**
@@ -155,6 +156,18 @@ public boolean isResetQualityGateVisible() {
return analysisResult.getReferenceBuild();
}
+ /**
+ * Renders the reference build as an HTML link.
+ *
+ * @return the reference build
+ * @see #getReferenceBuild()
+ */
+ @SuppressWarnings("unused") // Called by jelly view
+ public String getReferenceBuildLink() {
+ return ReferenceBuild.getReferenceBuildLink(
+ analysisResult.getReferenceBuild().map(Run::getExternalizableId).orElse("-"));
+ }
+
public boolean isZeroIssuesHighscore() {
return getNoIssuesSinceBuild() > 0 && analysisResult.getOwner().getNumber() > getNoIssuesSinceBuild();
}
diff --git a/plugin/src/main/resources/io/jenkins/plugins/analysis/core/model/ResultAction/summary.jelly b/plugin/src/main/resources/io/jenkins/plugins/analysis/core/model/ResultAction/summary.jelly
index 6ac50b9b57..12ccbeb45e 100644
--- a/plugin/src/main/resources/io/jenkins/plugins/analysis/core/model/ResultAction/summary.jelly
+++ b/plugin/src/main/resources/io/jenkins/plugins/analysis/core/model/ResultAction/summary.jelly
@@ -99,7 +99,7 @@