We are trying to do a sync between Topdesk and Jira. So far so good.
But when we try to add a comment to Jira with an attachment included, the attachment is only visible in the backend. When the customer checks the issue in the Portal they get a Preview Unavailable and cannot open the attachment.
This is the payload we are using for the comment api.
{ "body": { "type": "doc", "version": 1, "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "Here is the attached image:" } ] }, { "type": "mediaSingle", "attrs": { "layout": "center" }, "content": [ { "type": "media", "attrs": { "type": "external", "url": "https://domain.atlassian.net/secure/attachment/ID/FILENAME.png" } } ] } ] } }
I am not sure if you've already found the answer to this.
The json tells that the attachment is referenced incorrectly (type: external) in the comment body. This does not work properly in the JSM portal.
I do not know which/how you used REST API below are the correct API endpoints
for uploading the attachment
POST /rest/api/3/issue/{issueIdOrKey}/attachments
for adding comment
POST /rest/api/3/issue/{issueIdOrKey}/comment
If you need inline images the json would be like
"type": "media",
"attrs": {
"type": "file",
"id": "<mediaId>"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.