Forums

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

Add Attachment to Comment API

Connor Rosenthal September 19, 2024

Hello,

 

When adding in an attachment to the /attachments API endpoint and refrencing the attachment in a link to the /comments API with a link in my payload body, our users are still unable to see/view/download the attachment. Is there a way to upload the attachment to the /comments API without the workaround through the /attachments API, or is there a certain permission we can adjust so users can see these attachments?

1 answer

0 votes
Fernando Eugênio da Silva
Community Champion
October 2, 2024

@Connor Rosenthal 

If you're using the API /rest/api/3/issue/{issueIdOrKey}/attachments from Jira platform: The Jira Cloud platform REST API (atlassian.com), then this is the expected behavior. The reason is because you're adding an attachment direct to Jira issue which should be available only for internal users, for customers from your Service Management you should use the servicedesk APIThe Jira Service Management Cloud REST API (atlassian.com)

If you are unable to resolve adding the attachment via the JSM API, I suggest you create an automation in the following format:

Trigger: Field Value Changed > Select the Attachment field > For Edit Issue

Action: Add a comment > For content, insert this smartvalue: !{{fieldChange.toString}}!

PS.: Make sure to leave the comment public for customers

The automation will identify every time an attachment is added via the API /rest/api/3/issue/{issueIdOrKey}/attachments and the 'toString' is the name of the added attachment. Then it will just get the attachment and render it to the customer instead of just being in the analyst's view.

Hope this helps you :)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events