Feature #4985
closedFilter issues which are blocked
0%
Description
I would be nice if it was possible to filter issues which are blocked by other issues. This way the list would be less cluttered by issues, which can't be closed at present anyways.
The issues should appear on the list when the ticket(s) blocking them are closed
Related issues
Updated by Arndt Faulhaber about 14 years ago
Nice would also be a column with an blocked-icon in case the blocked filter is not used...
Cheers, Arndt
Updated by Arndt Faulhaber about 14 years ago
Updated by Maxim Nikolaevich over 13 years ago
may be somebody can create plugin for that?
BTW related code probably can be found here #2954 (i think 'blocked by' and 'duplicated' issues is very similar)
Updated by Maxim Nikolaevich over 13 years ago
other code about issue is available on #3265
Updated by Maccabee Levine over 13 years ago
I would like this as well; it's very difficult to make sense of an issue list when you can't see which items are actionable and which aren't.
Updated by Maxim Nikolaevich about 13 years ago
patch
s@spserv:~/sites/redmine/trunk$ svn diff Index: app/models/query.rb =================================================================== --- app/models/query.rb (revision 7841) +++ app/models/query.rb (working copy) @@ -222,6 +222,7 @@ "start_date" => { :type => :date, :order => 11 }, "due_date" => { :type => :date, :order => 12 }, "estimated_hours" => { :type => :float, :order => 13 }, + "related_to" => { :type => :list, :order => 15, :values => [["blocked by any open issue", "blocked by any open issue"]]}, "done_ratio" => { :type => :integer, :order => 14 }} principals = [] @@ -591,6 +592,29 @@ sql_for_field(field, '=', value, db_table, 'user_id') + ')' end + def sql_for_related_to_field(field, operator, value) + if operator == '=' + cond = 'IN' + else + cond = 'NOT IN' + end + + relation_table = IssueRelation.table_name + issue_table = Issue.table_name + link_type = 'blocks' + + statuses_table = IssueStatus.table_name + closed_issue_statuses = "SELECT id from #{statuses_table} WHERE is_closed=1" + + # all CLOSED issues have blocked links + linked_sql = "SELECT #{relation_table}.issue_to_id from #{relation_table}, #{issue_table} WHERE " + linked_sql << "relation_type='#{link_type}' AND " + linked_sql << "#{issue_table}.id = #{relation_table}.issue_from_id AND " + linked_sql << "#{issue_table}.status_id NOT IN (#{closed_issue_statuses})" + + "#{issue_table}.id #{cond} (#{linked_sql})" + end + def sql_for_member_of_group_field(field, operator, value) if operator == '*' # Any group groups = Group.all Index: config/locales/en.yml =================================================================== --- config/locales/en.yml (revision 7841) +++ config/locales/en.yml (working copy) @@ -314,6 +314,7 @@ field_scm_path_encoding: Path encoding field_path_to_repository: Path to repository field_root_directory: Root directory + field_related_to: Related field_cvsroot: CVSROOT field_cvs_module: Module
Updated by Jean-Philippe Lang about 12 years ago
- Status changed from New to Closed
- Resolution set to Duplicate
Dup of more generic #3265.