Can you add attachments to individual comments in JIRA issues?

Steve Perras
Contributor
February 5, 2012

I want to be able to add attachments to individual issues in JIRA.

12 answers

4 votes
Dimitrios M September 11, 2014

It was (and is) very frustrating for all of us to find out that you cannot attach your files to an individual comment. The feature of our work is to have sometimes more than 50 screenshots and files in an issue. For god's sake, how should anyone find its way easily trough the jungle of attachments?

This such simple feature is a big minus to JIRA!

At least: while uploading files/images.. relate them automatically to the comment. What's the problem?

To answer your title, comments, no, as comments belong to issues, alongside attachments.

To answer the body of the question, yes, you attach files to individual issues in Jira.

Then give me your solution how you would deal with 50+ attachments when you need to open them while browsing comments?

Deleted user February 28, 2018

I agree.  We have been on Jira for 2 weeks and already I am seeing tasks with a dozen attachments all grouped together.  We typically add attachments throughout the progress of the issue, so after a while it becomes a very confusing mess to sort through and figure out which attachment goes with which comments.

4 votes
Carl Myers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 14, 2012

Although, if you set your "comment renderer" to render wiki markup, and attach a file "example.jpg", then put "!example.jpg!" in your comment, jira will render the image inline. So while the attachment is "on the issue", it renders it inline in the comment. does that help?

Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 14, 2013

For email interactions: Related to inline images, JEMH 1.3.28 can now automatically inject relavent wiki markup for inline rendering of attached images.

If you just want a way to know what files were uploaded against a comment, JEMH can also provide links to non-image files as a comment 'footer'.

2 votes
Alex Taylor
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 14, 2012

What we did was to write a custom renderer for Comment fields:

public class AttachmentCommentRenderer extends AtlassianWikiRenderer
{
    private final CommentManager commentManager = ComponentManager.getInstance().getCommentManager();

    public AttachmentCommentRenderer(EventPublisher eventPublisher)
    {
        super(eventPublisher);
    }
    
    public String getRendererType() 
    {
        return "attachment-comment-renderer";
    }
    
    public String render(String s, IssueRenderContext issueRenderContext)
    {
        s += getAttachmentLinks(issueRenderContext.getIssue(), s);
        
        return super.render(s, issueRenderContext);
    }
    
    private String getAttachmentLinks(Issue issue, String comment)
    {
        Collection<Attachment> attachments = issue.getAttachments();
        List<Comment>          comments    = commentManager.getComments(issue);
        
        for (Comment c : comments)
        {
            if (c.getBody().equals(comment))
            {
                Date created = c.getCreated();
            
                for (Attachment attachment : attachments)
                {
                    if (created.equals(attachment.getCreated()))
                        return "\r\n\r\n[^" + attachment.getFilename() + "]";
                }
            }
        }
        
        return "";
    }
}

This adds a little link for each attachment to the bottom of the comment that accompanied it. As it's not added to the content of the comment-field, it cannot be modified or deleted by a user, and if the attachment is removed the link will disappear as well.

Peter Olson July 16, 2012

Does this work for Jira 5.1? I'm new to Jira (came from redmine), how does one add this? Based on: https://confluence.atlassian.com/display/JIRA/Configuring+Renderers it looks like I need create a plugin...

Alex Taylor
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 17, 2012

We haven't upgraded to 5.1 yet so I don't know for certain, but I wouldn't expect a problem.

Peter Olson July 23, 2012

Could someone point me in the rigth direction on how to get this going?

Kathleen Jacobs
Contributor
June 18, 2013

ever figure this out? Do you need to create a plugin to add this?

Nick August 3, 2018

Anyone use this actively and know how to install it?

1 vote
Gareth Daniel Smith
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 7, 2015

This missing feature regularly drives me nuts.

 

1 vote
Anne Ward
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 21, 2015

I vote to have the ability to simply drag and drop attachments to INDIVIDUAL comments as a much needed feature in the future release. 

1 vote
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 5, 2012

To answer your title, comments, no, as comments belong to issues, alongside attachments.

To answer the body of the question, yes, you attach files to individual issues in Jira.

Steve Perras
Contributor
February 5, 2012

Thanks Nic. I meant to say comment in the body and not issues.

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 6, 2012

I thought it might be :-) Attachment handling in Jira is pretty basic, you add them to an issue, that's about it. When we've got complex lists of documents, we put the doc name in the comment, or more normally, write it up in Confluence instead.

0 votes
Emmanuel Mouille August 8, 2015

This page here says that attaching images to the comment section of the issue isn't doable

https://answers.atlassian.com/questions/83553

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 8, 2015

It hasn't changed since the original answer

0 votes
Gareth Daniel Smith
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 8, 2015

@Emmanuel Mouille - I suppose this is just an issue with the configuration of my particular JIRA instance, then...

Emmanuel Mouille August 8, 2015

I am guessing so. I only installed JIRA on my computer today to evaluate it and have not figured it out yet. I read that you have to enable attachements in the project permissions: https://confluence.atlassian.com/display/JIRA/Managing+Project+Permissions Gareth, would you like to colaborate on how to get this working? Transition to Skype to chat about it?

0 votes
Emmanuel Mouille August 8, 2015

Copy pasting the image below inline:

image2015-8-8 13:47:58.png

Nice! but how to configure JIRA instance to do this?

image2015-8-8 13:51:6.png

0 votes
meramo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 15, 2014

Subscribing

0 votes
midnightcodr
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 5, 2014

Adding attachments to individual comment is a very basic feature, and it's quite common, just look at github, gitlab or even PHPBB.

0 votes
Ernst Breternitz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 21, 2013

I am also VERY interested in adding attachments to a JIRA comment.
Need ability to include (not inline) regular text files, pictures, Word docs, PDF, etc.

Suggest an answer

Log in or Sign up to answer