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
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
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).
Thanks
From the point of view of us users this is a lie. The GUI very clearly allows the user to add an attachment via a comment.
Yes! The GUI has a clear segregated way to provide attachments to a comment and that shows in the comment itself.
Here's the concept:
"!sebastien-jermer-n7DY58YFg9E-unsplash.jpg|width=2048,height=1536!\n\nThis is a sample image."
The problem here is that jira escapes the added image with backslashes.
!logo.png|! becomes => \!logo.png\|\!
and will therefore not be displayed on the comment.
Any way to avoid this?
It looks like you're new here. Sign in or register to get started.