Delete attachments based on MIME type

Ben Robbins
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

1 vote
Answer accepted
Ben Robbins
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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events