code: @GET
      @Path("/job/{jobId}")
      @Description("Returns the job history for the given job Id")
      @Produces(MediaType.APPLICATION_JSON)
      public List<HistoryDTO> findByEntityId(@Context HttpServletRequest req,
          @PathParam("jobId") BigInteger jobId,
          @QueryParam("limit") int limit,
          @QueryParam("status") JobStatus status) {
          if (jobId == null || jobId.compareTo(BigInteger.ZERO) < 1) {
              throw new WebApplicationException("Job ID cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST);
          }
  
          Alert alert= _alertService.findAlertByPrimaryKey(jobId);
  
          if (alert == null) {
              throw new WebApplicationException(MessageFormat.format("The job with id {0} does not exist.", jobId), Response.Status.NOT_FOUND);
          }
          
          if(!alert.isShared()){
          	validateResourceAuthorization(req, alert.getOwner(), getRemoteUser(req));
          }
          List<History> historyList = status != null ? _historyService.findByJobAndStatus(jobId, limit, status)
                                                     : _historyService.findByJob(jobId, limit);
          return HistoryDTO.transformToDto(historyList);
      }
docs: Returns the list of job history record for the given job id.
  
  @param   req     The HTTP request.
  @param   jobId   The job id. Cannot be null.
  @param   limit   max no of records for a given job
  @param   status  The job status filter.
  
  @return  The list of job history records.
  
  @throws  WebApplicationException  Throws the exception for invalid input data.