Feature #16863
openProvide way to delete large number of issues
0%
Description
I integrate redmine with my applications 'auto bug submit' feature, so a given bug might have thousands of issues.
At this point, the bulk edit feature breaks down (although you can set issues per page to a large number, when you right click with more than about 500 issues selected, the URI is too long, so bulk edit fails).
Request: add a 'delete all' button with a confirmation alert in the same row as 'apply, clear,save'
Updated by Toshi MARUYAMA over 10 years ago
You can use "script/rails console".
$ RAILS_ENV=xxxx ruby script/rails console Loading xxxx environment (Rails 3.2.17) 1.8.7-p374 :001 > p = Project.find(1) 1.8.7-p374 :002 > p.issues.count (0.1ms) SELECT COUNT(*) FROM "issues" WHERE "issues"."project_id" = 1 => 47 1.8.7-p374 :003 > p.issues.each(&:destroy) ... 1.8.7-p374 :004 > p.issues.count (0.1ms) SELECT COUNT(*) FROM "issues" WHERE "issues"."project_id" = 1 => 0
Updated by Rob Jonson over 10 years ago
toshio harita - thanks for the comment.
would be nice to be able to do this in the UI though; Particularly making use of the filter system without having to drop down to sql.
so the case I was running earlier, subject contains <content>, category=<something>
I can do that easily in the UI, and let redmine write my sql for me.
I certainly could do this in code, but that applies to most of what I use Redmine for!
Updated by Felix Schäfer over 10 years ago
The Bulk edit menu has a "delete" button.
Updated by Rob Jonson over 10 years ago
Felix Schäfer - yes, I realise the bulk edit menu has a delete button, but it doesn't work when you have a large number of issues selected.
It generates a URL that is too big, and that causes the webserver to balk.
(by large number, I mean 500 or more)
Updated by Felix Schäfer over 10 years ago
Mmh, I understand the problem, though I'd say the problem is not Redmine in itself in that case. Does the request timeout or cause an error right away? If it is the former, then Redmine takes too long to process all the deletions and you reach the request time limit (which AFAIK Redmine has not, so this is an issue of the app server/web server).
If the request errors right away, then the URL length is at fault indeed. I don't know that Redmine or Rails would limit that either, so your app/web server is probably the one erroring on such URL.
Updated by Rob Jonson over 10 years ago
yup - it is a webserver limitation. Presumably, because the format for the url is
/deletestuff&id=[1,2,3,4,5....
tweaking the webserver might get you to have a different limit, but you're still going to hit a limit.
I'm suggesting using a different format (with a different button) for the case where you just want to delete everything that matches a filter
/deleteallmatchingfilter
in this case, the url doesn't need to contain 2,000 item ids - it just needs to reference the filter that produced the list, and the url length isn't an issue any more.