diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index 3880fe0eca..b367a369a4 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -395,6 +395,18 @@ public abstract class Run ,RunT extends Run T getCause(Class type) { + for (Cause c : getCauses()) + if (type.isInstance(c)) + return type.cast(c); + return null; + } + /** * Returns true if this log file should be kept and not deleted. *