How-to fix /auditing/view returns 500 Error Page

After installing and using Metadata for Jira in versions 4.5.0 to 4.5.1 it may happen that Audit Log page displays the following error page. 

The following lines exist in the server logs.

This error occurs if the audit logs contain one or more of our entries that could be processed by Jira up to version 8.0. The processing of the entries has changed to version 8.0 of Jira and now this error occurs.

Access to the audit logs is still possible using Rest (see also: https://docs.atlassian.com/software/jira/docs/api/REST/8.3.3/#api/2/auditing-getRecords).

Instructions

To fix the problem, you must perform the following steps:

  1. Log in as administrator
  2. Install Metadata for Jira >= 4.5.2
  3. Call the following URL 
    http://YOUR_JIRA_SERVER/rest/metadata/1.0/admin/cleanupProjectAuditLog
  4. The following lines can now be found in the server logs.

  5. After that, you can use the audit log again