Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Delete Attachment using Rest API gives 405

Satish.Kumar25 June 11, 2023

Hi,

I need to delete the attachment from an issue in jira using REST API.

I am using below end point :  

/rest/api/3/attachment/{id}

id = Attachment id

The error thrown is 405 Method Not Allowed.

 

User Role : Project Administrator 

 

Thanks and Regards,

Satish Kumar

2 comments

Comment

Log in or Sign up to comment
Rick Westbrock
Contributor
June 26, 2023

My first thought is to make sure you are using the DELETE method (not GET, POST etc.) I know it sounds obvious but I can't count the number of times I have been using Postman for rapid development where I copy an existing request and forget to change the method.

Like Jehan Bhathena likes this
Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 27, 2023

Hello @Satish.Kumar25 ,

The API seems to be working correctly.

Steps I used to verify:

* Use the GET "/rest/api/3/issue/{{issuekey}}"

* Fetch the Attachment ID and use it in the GET "/rest/api/3/attachment/{{attachmentID}}"

* Once you get a valid response from the above API, just edit the call type to DELETE instead of GET

Hope this helps

TAGS
AUG Leaders

Atlassian Community Events