Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-37945

Upgrade to JIRA 6 causes users to be unable to remove old attachments

XMLWordPrintable

      As of JIRA 6.0, JIRA introduced a new table to manage usernames: app_user. With this, all references to user names are now in lowercase.

      Problem

      After upgrade from a previous version to 6.0+, users are not able to manage their old attachments. They are also not seen as owners of the attachments.

      Steps to Reproduce

      • Have JIRA 5.x
      • Ensure that users can only have Delete Own Attachments and not the 'Delete All Attachments'
      • Log in as an user with capital letters in the username (e.g. Testuser)
      • Attach a file to a ticket
        • Notice that it can be managed/removed
      • Upgrade JIRA to 6.x
      • View the same attachment, as Testuser
      • Notice that it cannot be managed/removed
      • Newly attached files can be managed just fine.

      Cause

      The problem is that the fileattachment table is not properly updated to reflect the lowercase references. With that, users are not associated to their older attachments, thus cannot manage them.

      In the database, notice the following:

      jira622=# select id, issueid, filename, created, author from fileattachment ;
        id   | issueid |          filename           |          created           |  author  
      -------+---------+-----------------------------+----------------------------+----------
       10002 |   10000 | how-to-draw-godzilla-16.gif | 2014-04-17 12:59:11.845-07 | admin
       10003 |   10000 | n60mXA5.gif                 | 2014-04-17 13:02:57.969-07 | testuser
       10001 |   10000 | 1313889118993.jpg           | 2014-04-16 12:58:52.348-07 | Testuser
      (3 rows)
      
      • notice the authors:
        • the old attachment is listed with author "Testuser"
        • the new attachment is listed as "testuser"

      Workaround

      • Update the database and change the author names to be lowercase
        or
      • Have an account that is able to "Delete All Attachments" help manage old attachments

              Unassigned Unassigned
              dchan David Chan
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: