Ensure that issues have attachments

Use this script as a workflow transition validator to allow transition only if the issue has one or more attachments.

string errorMsg = "At least one file must be attached to the issue."; if(size(attachments) == 0) { return false, errorMsg; }

 

This script works only to check for the attachments that are already present for the current issue. If you need to check for attachments that are being added in the transition screen, please use !hasInput("attachments") instead of size(attachments) == 0.