Uploaded image for project: 'Jira Server and Data Center'
  1. Jira Server and Data Center
  2. JRASERVER-71490

When attaching a file with the same name in a comment, Jira renames the file, but not the reference to it




      Issue Summary

      There is a mechanism within Jira Server that when you upload an attachment, if that issue already has another file attached to it by the exact same name, Jira will rename that new file. If abc.txt already exists, then second such file by that name Jira renames to abc-1.txt as it is accepted from the browser and before attachment is complete.
      The problem here is that when doing this when adding a new comment, the mark down seen in the new unsaved comment does not reference the correct file that the user selected, but rather the original file on the issue.

      Steps to Reproduce

      1. Attach a file to a Jira issue, example filename such as abc.txt
      2. Make some change to the file in question (abc.txt), but then save it locally with the same filename
      3. On the same Jira issue, now create a comment, In that comment, use the toolbar to click the paperclip icon to attach a file, but instead of choosing the existing attachment, choose Browse and then on your local system select the new file by the same name
      4. Note that Jira will rename the newly attached file with the postfix of -x (where x is the number of other attachments by the same name plus one). For example, abc-1.txt

      Expected Results

      We expect that the still unsaved comment will be referencing abc-1.txt, because that is the same logical file that the end user selected

      Actual Results

      Instead, the unsaved comment is making reference back to the first attachment (abc.txt). This in turn is very unexpected to the end user that may have never even looked to see what that original file was. Since Jira is renaming the attachment automatically, then it should also automatically update the selected file reference before the user saves the comment.


      Currently there is no known workaround for this behavior. A workaround will be added here when available


        Issue Links



              Unassigned Unassigned
              aheinzer Andy Heinzer
              23 Vote for this issue
              35 Start watching this issue