With this tiny script, you can batch-remove attachments from issues by query.
git clone https://github.com/nepda/youtrack-attachment-cleaner.git
cd youtrack-attachment-cleaner
composer install
h|host
The youtrack host/URLu|username
The login usernamep|password
The login passwordq|query
The search query for the issuesf|pattern
An optional filter/pattern for attachment filenamesl|limit
The limit/maximum of issues fetched, default is 100.d|dry-run
If set, no attachments will be deleted, just output, what would the script do
To delete the first 1000 matching resolved issues in project 'Test' with attachments, which are created between 1990-01-01 and 2015-01-01.
php src/cleaner.php \
-h https://**.myjetbrains.com/youtrack \
-u root -p '**secret**' \
-q 'project: Test has: attachments created: 1990-01-01 .. 2015-01-01 State: Resolved' \
--pattern 'backtrace|logfile' \
--limit 1000
You can run this line until no results are found.