Feature #20129
open
Filter by subtasks to some level of depth
Added by Sebastian Paluch over 9 years ago.
Updated almost 4 years ago.
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.
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
Is there a chance to add this in one of the 3.1.x release?
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.
- Category changed from Issues to Issues filter
Toshi MARUYAMA wrote:
Please post by patch and add tests.
I would but unfortunately I don't know how to add tests :/
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 :/
source:trunk/test
Also available in: Atom
PDF