Skip to content

Instantly share code, notes, and snippets.

@npotier
Created October 13, 2021 12:50
Show Gist options
  • Save npotier/be13486b34db0f19a834a392ade2d3f8 to your computer and use it in GitHub Desktop.
Save npotier/be13486b34db0f19a834a392ade2d3f8 to your computer and use it in GitHub Desktop.
Delete Redmine issues from command line
# https://www.redmine.org/boards/2/topics/62095
# RAILS_ENV=production bin/rails console
> p = Project.find("$project_name")
> p.issues.where("closed_on < '#{365.days.ago}'").each(&:destroy)
# To perform this actions across all projects...
> Issue.where("closed_on < '#{365.days.ago}'").each(&:destroy)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment