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.
Community moderators have prevented the ability to post new answers.
Did you try using ComponentAccessor.getAttachmentManager() ?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can delete by using deleteAttachment(Attachment attachment) from AttachmentManager
check this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, Karel.
One way to do it - via REST call https://developer.atlassian.com/static/rest/jira/6.0.5.html#idp2008896
--
Cheers, Ignat.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.