Hi
I have an issue with a script that i have designed for Jira.
import com.atlassian.jira.component.ComponentAccessor
import org.apache.log4j.Category
def Category log = Category.getInstance("com.onresolve.jira.groovy.PostFunction")
log.setLevel(org.apache.log4j.Level.DEBUG)
def attachmentManager = ComponentAccessor.getAttachmentManager()
log.debug "--------- DELETE ATTACHMENTS ---------"
attachmentManager.getAttachments(event.issue).each {
if (it.getFilesize() <= 9000 && (it.getFilename().endsWith(".png") || it.getFilename().endsWith(".jpg") || it.getFilename().endsWith(".gif"))) {
attachmentManager.deleteAttachment(it)
}
}
This script is the listener its suppose to remove attachments of certain types and size. The issue is that it does not do this when an issue is created via email. It works perfectly when i create an issue in JIRA but not when creating an issue via an email. It executes but it does nothing.
Regards