The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Delete attachments based on MIME type

Ben R
Contributor
May 20, 2024

We've built an automation which currently removes attachments from issues based on the file name extension when an attachment is added (for example, anything not ending .jpeg).  We were looking to see if we can improve this as you can easily beat this (eg dodgyexcel.xlsm.jpeg).

We can see that you can obtain the MIME type of attachments using smart values but we cannot see anyway of changing/removing an attachment based on this value. Using the "Delete Attachments" action only allows "All Attachments" or those based on the file name. Choosing Edit issue and selecting the attachment field only allows you to copy the attachments.

Anyone else tried something similar?

Thanks

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Ben R
Contributor
May 21, 2024

Managed to work it out :) For anyone else attempting to achieve this, it is possible!

The following removes any attachments which are not images or macro-free spreadsheets, when attachments are added.

attachment-check-MIME.PNG

TAGS
AUG Leaders

Atlassian Community Events