Return the number of attachments.
Create and configure a Smart field using this expression in General parsing mode:
%{issue.attachments.length}
General