Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I attach files inside a comment?

Diego Manríquez February 5, 2024

Hello, 

I'm trying to add a file to an issue inside a comment, in some websites and other people's questions I found that they are doing it like this:

 

{
"body": "Comment",
"content": {
"type": "mediaSingle",
"content": [{
"type": "media",
"attrs": {"type": "external", "url": "C:\\FileURL"}
}]
}
}

 

But for me it's not working, In the issue I can see the comment but not the file. Any suggestions?

 

Thanks

 

2 answers

1 accepted

1 vote
Answer accepted
Marc - Devoteam
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, 2024

Hi @Diego Manríquez 

Welcome to the community.

If you want to achieve this via the API.

You first need to add the attachment to the issue, before you can refer it in a comment.

See this post for more information: https://community.atlassian.com/t5/Jira-Software-questions/How-can-I-add-an-image-in-a-comment/qaq-p/952016 

 

Diego Manríquez February 5, 2024

Thank you! That was the problem. I was trying to add the file directly from the comment instead of adding it before.

0 votes
Nikola Perisic
Community Champion
February 5, 2024

Welcome to community @Diego Manríquez !

In order to do this:

  1. View the issue
  2. Click on the "Add comment" input field
  3. That field will get expanded where you will an option for adding the attachments:

Screenshot 2024-02-05 at 10.23.24.png

Click on the picture icon as it adds more file types than just an image. I added a PDF for example.

Suggest an answer

Log in or Sign up to answer