diff --git a/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java b/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java index a0115cba2a74..ea8437510818 100644 --- a/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java +++ b/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java @@ -436,7 +436,15 @@ default void doBuild(StaplerRequest req, StaplerResponse rsp, @QueryParameter Ti * @see ParameterizedJobMixIn#doBuildWithParameters */ default void doBuildWithParameters(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter TimeDuration delay) throws IOException, ServletException { - getParameterizedJobMixIn().doBuildWithParameters(req, rsp, delay); + if (Util.isOverridden(ParameterizedJob.class, getClass(), "doBuildWithParameters", StaplerRequest.class, StaplerResponse.class, TimeDuration.class)) { + try { + doBuildWithParameters(StaplerRequest.fromStaplerRequest2(req), StaplerResponse.fromStaplerResponse2(rsp), delay); + } catch (javax.servlet.ServletException e) { + throw ServletExceptionWrapper.toJakartaServletException(e); + } + } else { + getParameterizedJobMixIn().doBuildWithParameters(req, rsp, delay); + } } /**