Jira does not differentiate between attachments of same name in comments while it does in the attachment section.
Jira allows attaching more than one file with the same name. Instead of replacing the file, the issue will simply have more than one attachment with the same name. When the attachment is an image and another image with the same name is attached, the previous comments with inline image/attachments will be pointed to the latest updated image (including the thumbnails).
- Create an issue.
- Attach an image, give it a meaningful name (e.g. sample-image.png).
- Add a comment, add attachment - either by visual editor or by using markup (e.g. same-name.png) so the thumbnail or full image will be displayed.
- Attach another image with the same name as in step 2 (e.g. same-image.png).
- At this point Jira will have 2 different attachment images rendered, both have same name. Jira has 1 comment with an attachment.
- Add a new comment with the image.png in it, it doesn't matter which one you choose (e.g. same-name.png)
- Notice - the above steps will 'work' also with attachments pasted directly from the clipboard (i.e. take a screen shot 1, then paste into the attachment area of the ticket, then take another screen shot and paste into the same area; while at first the thumbnails will look different, on hitting 'submit' button the thumbnails will change to show only 1 attachment)
Jira shows the images/thumbnails according to the images that were attached and selected.
The image/thumbnail shown in all old or new comments (with the same name) will be the one from the last image attached with that name.
- Pasting an image in Jira will already give it a unique name, so the only way to provoke this is by manually adding files with the same name, the first workaround would be to use unique attachment/images names.
- In a Support/helpdesk environment, the admins/agents do not have control over the mail client that the customers use, which in most of the cases, image/attachments are pasted directly to the body of the mail causing the default file naming to be identical, making the workaround suggested difficult almost impossible to enforce and this can seriously cripple the usability of JIRA as the old comments (with the same file name) no longer represent the state that it should be in and to add to the pain, the incoming mail is being deleted upon creation which removes the reference to track back and causes confusion especially on a long running case where 4-5 inline images are added and they have to rely on the time recorded when the issue is added to reference it back.
- Impact on Service Desk (SOLVED: Both drag and drop and pasting images in the Customer Portal): there is impact caused in part by the behavior reported in this bug request in combination with another behavior on the SD Customer Portal, since this specific to Service Desk, the interest for an improvement is being tracked at
JSDSERVER-4100Update existing attachment with same name):
- Customers cannot see the list of attachments from the customer portal, so they can only the single attachment across all comments in the mentioned case. Certain screenshot tools and/or inline attachments added via mail would be using the same attachment name for a file - delivering a bad user experience in customer portal.
- Pasting an image using ctlr+v in the customer portal will name the file as image.png, regardless of how many images are pasted, and this could cause that a customer adding one comment with 3 images with the same name will result in the 3 images looking as the same image from the visibility of the customer, causing a lot of confusion.
To have the ability to configure the attachments to be appended with time stamp. There should be a toggle in project level so that user get to choose if this only applies to specific projects. Also could consider wiki markup with a timestamp column, to place that information to point the attachment to the right one.
Frequently, we have users who upload images or project requirement Word docs to a JIRA project and when the project changes they upload an updated version of the document again. This ends up in showing the same file name twice.
1) Provide the user the ability to overwrite (update) an attachment they have already uploaded. (Even if they don't have manage attachments? Or only if they do? Not sure.)
2) When a user uploads a file with a filename that has already been uploaded, change the visible filename to myfile.gif (2) or something similar.