Is there an automated way to delete attachments from completed issues?

Jessica Verge August 2, 2016

Is there an automated way to delete attachments from completed issues?

3 answers

0 votes
Jessica Verge August 9, 2016

We are running on the cloud. We are only allowed a certain amount of space. I can't seem to find where to see how much space we have used. Trying to stay in front of the situation and not wait til we hear from Atlassian and possibly get charged by them for having to clear the space for us. We are using JIRA to track Advertising/Marketing jobs, the attachments of completed issues aren't extremely important. Everything that gets attached we have on our local servers somewhere.

0 votes
Robert Massaioli _Atlassian_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 8, 2016

Can I ask why you would want to do this? Should the attachments not just remain on the issue?

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
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 2, 2016

Use the removeAttachment action from JIRA Command Line Interface (CLI). That can be combined with other actions to meet your requirement:

jira --action runFromIssueList --jql "project=XXX and status=Closed" --common "--action runFromAttachmentList --issue @issue@ --common \"--action removeAttachment --issue @issue@ --id @attachmentId@\" "

Put that in your favorite job scheduler and run it every week for instance. You can make it more efficient by improving the JQL to limit the number of issues you check weekly - something like "and updatedDate > -8 days".

Suggest an answer

Log in or Sign up to answer