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|hostThe youtrack host/URLu|usernameThe login usernamep|passwordThe login passwordq|queryThe search query for the issuesf|patternAn optional filter/pattern for attachment filenamesl|limitThe limit/maximum of issues fetched, default is 100.d|dry-runIf 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.