code: public Stage rerunJobs(final Stage stage, final List<String> jobNames, final HttpOperationResult result) {
          final StageIdentifier identifier = stage.getIdentifier();
          HealthStateType healthStateForStage = HealthStateType.general(HealthStateScope.forStage(identifier.getPipelineName(), identifier.getStageName()));
  
          if (jobNames == null || jobNames.isEmpty()) {
              String message = "No job was selected to re-run.";
              result.badRequest(message, message, healthStateForStage);
              return null;
          }
          try {
              Stage resultStage = lockAndRerunStage(identifier.getPipelineName(), identifier.getPipelineCounter(), identifier.getStageName(), (pipelineName, stageName, context) -> {
                  StageConfig stageConfig = goConfigService.stageConfigNamed(identifier.getPipelineName(), identifier.getStageName());
                  String latestMd5 = goConfigService.getCurrentConfig().getMd5();
                  try {
                      return instanceFactory.createStageForRerunOfJobs(stage, jobNames, context, stageConfig, timeProvider, latestMd5);
                  } catch (CannotRerunJobException e) {
                      result.notFound(e.getMessage(), e.getMessage(), healthStateForStage);
                      throw e;
                  }
              }, new ResultUpdatingErrorHandler(result));
  
              result.accepted(String.format("Request to rerun jobs accepted", identifier), "", healthStateForStage);
              return resultStage;
          } catch (RuntimeException e) {
              if (result.canContinue()) {
                  String message = String.format("Job rerun request for job(s) [%s] could not be completed because of unexpected failure. Cause: %s", StringUtils.join(jobNames.toArray(), ", "),
                          e.getMessage());
                  result.internalServerError(message, healthStateForStage);
                  LOGGER.error(message, e);
              }
              return null;
          }
      }
docs: IMPORTANT: this method is only meant for TOP level usage(never use this within a transaction). It gobbles exception.