I think it is not possible to do that from JQL. Jamie Echlin's script runner has an issue function that can help, also you can create a custom field to query.
Here is some info here:
Sure Hazel. Admin would create a field called "Number of Attachments" and update them manually accordingly. Then you can query on those. Unfortunately, there is not a way to automatically filter/order issues by the number of attachments OOTB.
Atlassian Summit is an excellent opportunity for in-person support, training, and networking.Learn more
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG