DATA CENTER AND SERVER | CLOUD
Folder attachments disappear after restarting Jira or re-enabling R4J plugin
Problem
Affected easeRequirements versions on Jira Server and Data Center: 4.13.1, 4.14 or 4.14.1
After a restart of Jira or after disabling/re-enabling easeRequirements, the attachments of some folders not available anymore:
Attachment of easeRequirements folders do not exist anymore.
Within the easeRequirements folder descriptions, the embedded images (attachments) are shown as a broken image.
Jira issues are NOT affected.
Cause
Improvement of easeRequirements to these versions which should remove unused or temporary attachments only.
Workaround
If you’re in version 4.13.1, 4.14, or 4.14.1, upgrade to 4.13.2, 4.14.2, or higher without restarting Jira or disabling the plugin.
Solution
Upgrade to easeRequirements 4.13.2, 4.14.2, or higher.
If your folder attachments have been lost, you can recover these from your Jira DB backups and either:
Manually upload the attachments to your respective folders in the easeRequirements folder user interface or
If the attachments are non-existing in your local machine, you can copy the attachment data from a previous database backup to the current database, and then manually copy and rename/match the attachments in the application directory.
If you plan to proceed with the solution #2, here are some important notes before you proceed with this option:
We strongly recommend to make backups always before doing any database changes.
Restore the last backup in your test/staging instance with the attachment still existing (could be from the previous version installed before installing 4.13.1, 4.14, or 4.14.1) for table "AO_242870_ATTACHMENT" only.
Limitation: New attachments added from the previous database backup up to the current database in table "AO_242870_ATTACHMENT" will be lost.
After the attachment data has been restored to the current database, you still need to put the attachments in the application directory.
Go to the folder that you want to attach to and get the folder id from the URL.
Query easeRequirements table "AO_242870_ATTACHMENT" to get the attachments for the folder in #1:
SELECT FOLDER_ID,DISPLAY_NAME,FILE_NAME FROM "AO_242870_ATTACHMENT" WHERE "FOLDER_ID" = <folder_id>
Each attachment in "AO_242870_ATTACHMENT" was saved with the file name as DISPLAY_NAME and an auto-generated UUID as FILE_NAME.
Go to the application directory (…/jira/data/ease.requirements.files/folders/attachments/<project_key>/<folder_id>).
Put the attachment with the corresponding DISPLAY_NAME from your system to the application directory and rename it to the UUID value in FILE_NAME in #3.
Refresh the folder. The attachments should now be displayed.
Repeat from step #1 for all other attachments.