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.
defsql_for_subtasks_depth_field(field,operator,value)caseoperatorwhen"*"returnwhen"!*""(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||0depth_to=value.last.to_i||0ifdepth_from>0depth_from=depth_from-1endifdepth_to>0depth_to=depth_to-1end"(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_selsedepth=value.last.to_i||0ifdepth>0depth=depth-1end"(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_sendend