Actions
Feature #20129
openFilter by subtasks to some level of depth
Status:
New
Priority:
Normal
Assignee:
-
Category:
Issues filter
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Description
With respect to #6118, the only option that seems to be missing under "subtasks" is ability to show issue hierarchy depth to some level. This is useful to see overall list of job to do for a project to some level of details.
Updated by Sebastian Paluch over 9 years ago
Here is the SQL for "subtasks_depth" filter:
def sql_for_subtasks_depth_field(field, operator, value)
case operator
when "*"
return
when "!*"
"(SELECT (COUNT(parents.id) - 1) FROM #{Issue.table_name} AS parents WHERE #{Issue.table_name}.lft BETWEEN parents.lft AND parents.rgt AND #{Issue.table_name}.root_id = parents.root_id) = 0"
when "><"
depth_from = value.first.to_i || 0
depth_to = value.last.to_i || 0
if depth_from > 0
depth_from = depth_from -1
end
if depth_to > 0
depth_to = depth_to -1
end
"(SELECT (COUNT(parents.id) - 1) FROM #{Issue.table_name} AS parents WHERE #{Issue.table_name}.lft BETWEEN parents.lft AND parents.rgt AND #{Issue.table_name}.root_id = parents.root_id) BETWEEN " + depth_from.to_s + " AND " + depth_to.to_s
else
depth = value.last.to_i || 0
if depth > 0
depth = depth -1
end
"(SELECT (COUNT(parents.id) - 1) FROM #{Issue.table_name} AS parents WHERE #{Issue.table_name}.lft BETWEEN parents.lft AND parents.rgt AND #{Issue.table_name}.root_id = parents.root_id) " + operator + " " + depth.to_s
end
end
Updated by Sebastian Paluch over 9 years ago
Is there a chance to add this in one of the 3.1.x release?
Updated by Toshi MARUYAMA over 9 years ago
Sebastian Paluch wrote:
Is there a chance to add this in one of the 3.1.x release?
Please post by patch and add tests.
Updated by Toshi MARUYAMA almost 9 years ago
- Category changed from Issues to Issues filter
Updated by Sebastian Paluch over 8 years ago
Toshi MARUYAMA wrote:
Please post by patch and add tests.
I would but unfortunately I don't know how to add tests :/
Updated by Toshi MARUYAMA over 8 years ago
Sebastian Paluch wrote:
Toshi MARUYAMA wrote:
Please post by patch and add tests.
I would but unfortunately I don't know how to add tests :/
Actions