プロジェクト

全般

プロフィール

Vote #76477

未完了

Filter by subtasks to some level of depth

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Issues filter_56
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
56
version_id:
0
issue_org_id:
20129
author_id:
115781
assigned_to_id:
0
comments:
8
status_id:
1
tracker_id:
2
plus1:
2
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

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.


journals

Here is the SQL for "subtasks_depth" filter:

<pre><code class="ruby">
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
</code></pre>
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------

Admin Redmine さんがほぼ2年前に更新

  • カテゴリIssues filter_56 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0