Forums

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

Jira Cloud REST API Debugging for Adding Attachments

Huw Carpenter April 4, 2022

Hi,

Is there a way of debugging Jira Cloud operations carried out via the REST API, e.g. viewing internal logs? 

I am trying to attach a file to an existing issue, following the steps outlined at https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/#api-rest-api-3-issue-issueidorkey-attachments-post, and I'm getting a 200 OK response back from Jira(albeit with a response body of "[]"), but the attachment never appears on the issue, so wondering if I can work out what went wrong, since there's no information in the response to indicate the issue.

I've double checked that I'm following the syntax of the API for adding the attachment (including adding the "X-Atlassian-Token" header), and that the permissions on both the user and the project are correct for adding attachments, but the only thing I could find that's close to debug logging of the API is System -> Audit Log, which doesn't log anything as low level as adding attachments to an issue.

1 answer

1 accepted

0 votes
Answer accepted
Huw Carpenter April 6, 2022

I solved this problem eventually, the cause was not setting the filename or content type on the form data for the attachment (I was just reading a stream into form data originally). With the new information set, I still get a 200 OK to my request, but with a full response JSON body, and the attachment is available on Jira through the UI.

Suggest an answer

Log in or Sign up to answer