Adjust report template to Include last 3 reports

Hi! I need to modify the code for report templates. Is it possible to make the template export the last 3 reports?

This is to confirm that the host has persistent issues. Here, the host reported one error, but it will clear after the next run, and the host’s status will return to “OK.”

# ...
   <%- load_hosts(search: input('hosts'), includes: :host_statuses).each_record do |host| -%>
  <% global_status = host.global_status == 0 ? 'OK' : host.global_status == 1 ? 'Warning' : 'Error' -%>
   <%-   report_row({
         'Name': host.name,
         'Global': global_status,
         'Build': host_status(host, 'Build'),
         'Configuration': host_status(host, 'Configuration'),
         'Last Report': host.last_report,
       }) -%>
   <%- end -%>
   <%= report_render -%>

Foreman versions:
2.1.4

Rendered reports are only kept for 24 hours. Within that 24 hours, currently there’s no easy way to retrieve past reports, unless you save the report URL from when it is first generated. (However, we do have an RFE somewhere about this, so hopefully some time in the future it will be easier.)