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: How to ensure AIO reports accessibility if the creator is removed, 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.
Identify the user who owns the lost reports.
For this is necessary to analyze the content of the
app_user
table and look for theuser_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>';
With the
user_key
, after analyzing the content of theAO_6B9F04_AIO_USER
theowner_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.
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>';
Update the owner for all the reports identified in the previous step. An example SQL query is below:
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.