How to send attachments to a comment through the REST API?

Hello, I am trying to send a comment through the REST API but I don't see in the documentation a valid endpoint to send an attachment to a comment, thanks

2 answers

1 accepted

This widget could not be displayed.

In JIRA, attachments are not bound to comments, but rather to specific issues in JIRA.  There is way add attachments in JIRA via REST, the endpoint in JIRA is /api/2/issue/{issueIdOrKey}/attachments

https://docs.atlassian.com/jira/REST/server/#api/2/issue/{issueIdOrKey}/attachments-addAttachment

This widget could not be displayed.

There are some examples of using the API here:

 

https://developer.atlassian.com/confdev/confluence-server-rest-api/confluence-rest-api-examples

but maybe you can explain better what you are trying to do?

If you want an attachment to be diplayed inside a comment, you will probably have to first attach the attachment to the page (I don't think you can attach an attachment to a comment, only to its parent page), and then submit a comment with the necessary storage format (you can look at the storage format of an attachment displayed in a page to see what you need).

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

135 views 16 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you