How to change ownership of a report through the database in Data Center

When a report is created using the Reports and Timesheets for Jira app, it is recommended to follow the instructions given on: , to maintain the accessibility to this report in case the user is not available. If these instructions were not followed before the user is inactive, it is possible to change the ownership through the database (Data Center instance) following the instructions below:

 Instructions

Step-by-step guide.

  • Please note these steps should be performed on a Staging or Test instance first and once is confirmed that all is good, perform those changes on Production.

  • It is always a good practise and a recommended to take a back up of the production database.

  1. Identify the user who owns the lost reports.

    1. For this is necessary to analyze the content of the app_user table and look for the user_key that belongs to the user with a particular username. An SQL query example is below:

      SELECT "user_key" FROM "app_user" WHERE "lower_user_name" = '<username>';
  2. With the user_key, after analyzing the content of the AO_6B9F04_AIO_USER the owner_id will be obtained. The SQL example is below:

    SELECT "ID" FROM "AO_6B9F04_AIO_USER" WHERE "ACCOUNT_ID" = '<user_key>';

The first two steps are necessary also to identify the information of the user who will be the new owner for the reports.

  1. List all reports owned by this user, the SQL example is the following:

    SELECT "ID", "NAME", "OWNER_ID" FROM "AO_6B9F04_AIO_REPORT" WHERE "OWNER_ID" = '<owner id for that user>';
  2. Update the owner for all the reports identified in the previous step. An example SQL query is below:

  1. Update email subscriptions for all the reports with updated owners:

  • Please note this is a workaround on a special situation, all measures should be taken to avoid direct changes to the database.

  • Currently we also have an improvement request for this purpose.