Use case
Return the number of users who have added attachments to the issue.
Expression
Create and configure a Smart field using this expression in Jira expression mode:
issue.attachments.map(attachment => attachment.author.accountId).reduce((a, b) => a.includes(b) ? a : a.concat(b), []).length