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

How do I programmatically remove JIRA attachments?

Rudepeklo August 6, 2013

Hello,

is it possible to programmatically remove existing JIRA attachments?

I am developing JIRA plugin that will process incoming emails and create or update issues in JIRA. Part of this process is adding attachments that come with these emails. When these attachments change, I would like to update those files in JIRA too.

Right now, I am only able to create new attachment using MessageHandlerContext but not remove or replace existing one.

thank you in advance for any advice.

6 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
MB
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2013
Rudepeklo August 6, 2013

Thank you both for quick answer.

The class AttachmentManager is exactly what I was looking for, I don't know how I could miss it. Thanks a lot.

1 vote
RambanamP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2013
Rudepeklo August 6, 2013

Thank you, that did the trick.

0 votes
Ignat
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 3, 2014

Andrew,

The resource is in there, docs are available here: https://docs.atlassian.com/jira/REST/latest/#d2e1451

JIRA may answer with a 405 code, for the unsupported request method. This resource expect HTTP DELETE method.

--

Cheers,

Ignat.

Andrew DeFaria November 4, 2014

Who said anything about delete?

0 votes
Andrew DeFaria November 3, 2014

How exactly do you do  ComponentAccessor.getAttachmentManager() in Perl?

@Ignat Alexeyenko, that REST call appears to be for 6.0.5. I do not see anything like it in 6.3.9 (https://docs.atlassian.com/jira/REST/latest/#d2e2396). Was functionality removed? In fact, attempting to use http://jiraserver/rest/api/2/attachment?<id> yields a 405 method not allowed for me. sad

0 votes
Rudepeklo August 6, 2013

Thank you both for quick answer.

The class AttachmentManager is exactly what I was looking for, I don't know how I could miss it. Thanks a lot.

0 votes
Ignat
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 6, 2013

Hello, Karel.

One way to do it - via REST call https://developer.atlassian.com/static/rest/jira/6.0.5.html#idp2008896

--

Cheers, Ignat.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events