*/
protected Cause createUpstreamCause(AbstractBuild<?, ?> build) {
if(Jenkins.getInstance().getPlugin("promoted-builds") != null) {
// Test only when promoted-builds is installed.
if(build instanceof Promotion) {
Promotion promotion = (Promotion)build;
// This cannot be done for PromotionCause#PromotionCause is in a package scope.
// return new PromotionCause(build, promotion.getTarget());
return new UpstreamCause((Run<?,?>)promotion.getTarget());
}
}
return new UpstreamCause((Run) build);
}