Feature #6118

Filter by parent task or subtasks

Added by Xagyg Wulf over 7 years ago. Updated over 2 years ago.

Status:ClosedStart date:2010-08-12
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Issues
Target version:3.1.0
Resolution:Fixed

Description

There doesn't seem to be an option to use "parent task" as a filter. I want to be able to select parent task as a filter and say "Parent Task is null" - so that I get all top-level issues (as well as issues without any children).

6118-add_parent_issue_id_filter_to_issue_query.patch Magnifier (543 Bytes) Felix Schäfer, 2014-10-16 18:54

rm6118-add_parent_issue_id_filter_to_issue_query-trunk_r13697.diff Magnifier (2.94 KB) Mischa The Evil, 2015-02-13 07:19


Related issues

Related to Redmine - Patch #6431: Allow parent task field to be used in filters New 2010-09-18
Related to Redmine - Feature #5325: Add Parent Task to 'Group Results By' drop down New 2010-04-15
Related to Redmine - Feature #6116: Group sub-tasks with parent on issue list New 2010-08-12
Related to Redmine - Feature #9992: Ability to filter issue subtasks in issue form New
Related to Redmine - Feature #10828: Request multiple distinct values including issue id, pare... New
Related to Redmine - Feature #13054: Add the ability to filter issues on parent task. New
Related to Redmine - Feature #22147: Change "Related issues" label for generic grouped query f... Closed
Duplicated by Redmine - Feature #5728: Parent task field should be made available as filter in t... Closed 2010-06-22
Duplicated by Redmine - Feature #9592: Filtering by parent task Closed 2011-11-17
Duplicated by Redmine - Feature #10763: REST-API: Please add "parent_issue_id" as filter for requ... Closed

Associated revisions

Revision 14304
Added by Jean-Philippe Lang over 2 years ago

Adds issue filters on parent/subtasks (#6118).

Revision 14305
Added by Jean-Philippe Lang over 2 years ago

Adds test for when filtering on invalid issue ids (#6118).

Revision 14310
Added by Jean-Philippe Lang over 2 years ago

Fixed test failure (#6118).

History

#1 Updated by Xagyg Wulf over 7 years ago

Whoops - strike the bit in brackets "(as well as issues without any children)".

This is what I meant:

I want to be able to select parent task as a filter and say "Parent Task is null" - so that I get all top-level issues.

#2 Updated by Sepp _ over 7 years ago

+1

#3 Updated by Jeffrey Jones over 7 years ago

+1 This would be a hugely useful feature for things like the Gantt chart where we want an overview.

#4 Updated by Anders Fältros over 7 years ago

+1 Really would like to have this!

#5 Updated by Ewan Makepeace about 7 years ago

+1

We have added a patch to sum all the estimated issues on the page, all the issues returned by the query and also those in each group when grouped. Parent tasks are causing us to double (or triple) count some hours as they report the sum of all their child tasks (which may also be in the same list). Even with a filter on Parent Task (which I support) I still have a problem - could there be a 'Has Child Tasks' filter as well perhaps?

#6 Updated by Emmanuel Toche about 7 years ago

+1

#7 Updated by Sylvain Guimond about 7 years ago

+1

#8 Updated by Charlie Chen about 7 years ago

+1

#9 Updated by Martin Denizet (redmine.org team member) over 6 years ago

My users don't like sub-tasking because they feel like it's making things more complicated and messy than before.
I think a "Is Parent" filter would really help them!
+1

#10 Updated by David Andrews over 6 years ago

+1 please.

#11 Updated by Ruedi Silvestri over 6 years ago

+1 also a patch would be much appreciated.

#12 Updated by Terence Mill over 6 years ago

+1

#13 Updated by Lucas CORBEAUX over 6 years ago

+1, such a filter would be really useful.

#14 Updated by Terence Mill over 6 years ago

+1

#15 Updated by Etienne Massip over 6 years ago

  • Category set to Issues

#16 Updated by Matthias Neubert over 6 years ago

+1 seems that there will be some progress regarding this issue, can you determine for which version number this is planed?

regards
Matthias

#17 Updated by Mischa The Evil about 6 years ago

This feature was first requested via issue #5728. It was created by the UX-Team after UXTeamMeeting1 (see their meeting minutes, under "Core Challenges Observed with Subtask Feature:", number 2).
I've just closed #5728 as a "duplicated by" of this issue since most of the (relevant) discussion has taken place here (as suggested by Colan Schwartz).

#18 Updated by Mischa The Evil about 6 years ago

  • Target version set to Unplanned

This, along with #6116 / #5325, seems important things to improve handling of subtasks.

#19 Updated by Bartosz Cisek almost 6 years ago

+1

#20 Updated by Gokay Gok almost 6 years ago

+1

#21 Updated by Paweł Maruszczyk over 5 years ago

+1

#23 Updated by Tomas K over 5 years ago

+1

#24 Updated by Hugo Zambotti over 5 years ago

+1

#25 Updated by Florent Fievez about 5 years ago

+1

#27 Updated by Josh Hansen about 5 years ago

+1

#28 Updated by Daniel Felix almost 5 years ago

Mischa The Evil wrote:

This, along with #6116 / #5325, seems important things to improve handling of subtasks.

Agree! This could be handsome on greater projects with much subtasks.

#29 Updated by Thomas Lmx almost 5 years ago

+1
It seems to be the most important feature for my project !

#30 Updated by David Robinson almost 5 years ago

+1

#31 Updated by Dominik Follmann almost 5 years ago

Thomas Lmx wrote:

+1
It seems to be the most important feature for my project !

same for us.

#32 Updated by Daniel Felix almost 5 years ago

Reference also #9992-8

#33 Updated by Alexey Efimov almost 5 years ago

+1 I'm interested in this feature also.

#34 Updated by Sylvain Just almost 5 years ago

+1 this feature will be very usefull for me too.

If anybody is interested, I also made a patch for display the parent subject and/or ID in email subject notification.
This information allow project manager to create template task with generic sub-tasks and copy it for recursives task.
Notifications by mail make more sense when subtask subject depends of parent subject.

Note : when task is just created, parent subject is unknown... so I display parent id instead of.

diff -r 64316d392708 -r 0f36159c4d63 app/models/mailer.rb
--- a/app/models/mailer.rb  Tue Jan 22 16:06:10 2013 +0100
+++ b/app/models/mailer.rb  Tue Jan 22 16:06:55 2013 +0100
@@ -43,9 +43,15 @@
     @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue)
     recipients = issue.recipients
     cc = issue.watcher_recipients - recipients
+   #s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) " 
+   s = "[#{issue.project.name} - " 
+   s << "#{issue.tracker.name} " if (issue.tracker.id != 4)
+   s << "##{issue.id}] (#{issue.status.name}) " 
+   s << "##{issue.parent_issue_id} > " if issue.parent_issue_id
+   s << "#{issue.subject}" 
     mail :to => recipients,
       :cc => cc, 
-      :subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}" 
+      :subject => s
   end 

   # Builds a Mail::Message object used to email recipients of the edited issue.
@@ -65,8 +71,11 @@
     recipients = issue.recipients
     # Watchers in cc
     cc = issue.watcher_recipients - recipients
-    s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] " 
+    s = "[#{issue.project.name} - " 
+   s << "#{issue.tracker.name} " if (issue.tracker.id != 4)
+   s << "##{issue.id}] " 
     s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
+   s << "#{issue.parent.subject} - " if issue.parent
     s << issue.subject
     @issue = issue
     @journal = journal

You can also patch your project to display parent subject instead of tracker and ID in issues list :

diff -r 70ce4d70b7e1 -r 61345a556b62 app/helpers/application_helper.rb
--- a/app/helpers/application_helper.rb Tue Jan 22 16:12:26 2013 +0100
+++ b/app/helpers/application_helper.rb Tue Jan 22 20:10:39 2013 +0100
@@ -64,10 +64,13 @@
   #   link_to_issue(issue, :truncate => 6)        # => Defect #6: This i...
   #   link_to_issue(issue, :subject => false)     # => Defect #6
   #   link_to_issue(issue, :project => true)      # => Foo - Defect #6
+  #   link_to_issue(issue, :title => subject)     # => This is the subject: Defect #6
+  #                                              # if 'id' or nil => default behavior
   #
   def link_to_issue(issue, options={})
     title = nil 
     subject = nil 
+   if options[:title] == nil || options[:title] == 'id'
     if options[:subject] == false
       title = truncate(issue.subject, :length => 60) 
     else
@@ -82,6 +85,18 @@
     s << h(": #{subject}") if subject
     s = h("#{issue.project} - ") + s if options[:project]
     s   
+   elsif options[:title] == 'subject'
+       subject = issue.subject
+       if options[:truncate]
+         subject = truncate(subject, :length => options[:truncate])
+       end
+       tracker = "#{h(issue.tracker)} ##{issue.id}" 
+       s = link_to subject, {:controller => "issues", :action => "show", :id => issue},
+                                                    :class => issue.css_classes,
+                                                    :title => tracker
+       s = h("#{issue.project} - ") + s if options[:project]
+       s
+   end
   end 

   # Generates a link to an attachment.
diff -r 70ce4d70b7e1 -r 61345a556b62 app/helpers/queries_helper.rb
--- a/app/helpers/queries_helper.rb Tue Jan 22 16:12:26 2013 +0100
+++ b/app/helpers/queries_helper.rb Tue Jan 22 20:10:39 2013 +0100
@@ -72,7 +72,7 @@
     when 'FalseClass'
       l(:general_text_No)
     when 'Issue'
-      link_to_issue(value, :subject => false)
+      link_to_issue(value, {:subject => false, :title => 'subject'})
     else
       h(value)
     end

#35 Updated by André Schloemp over 4 years ago

+1 we need this feature

#36 Updated by Vito Marolda over 4 years ago

+1

#37 Updated by Sergio Tendero over 4 years ago

+1

#38 Updated by loic Le Gallou over 4 years ago

+1 (display should include indirect subtasks in order to see the full branches related to a top parent task)

#39 Updated by Artem Beloglazov over 4 years ago

+1

#40 Updated by Jeffrey Clark over 4 years ago

Patch in #10828 should resolve this issue.

#41 Updated by Toshi MARUYAMA over 4 years ago

  • Related to Feature #10828: Request multiple distinct values including issue id, parent_id, root_id added

#42 Updated by Maxime Vez over 3 years ago

+1

#43 Updated by Laurent Dairaine about 3 years ago

+1

#44 Updated by Felix Schäfer about 3 years ago

Here is a patch that adds a filter for parent task on the issue list.

#45 Updated by Mischa The Evil about 3 years ago

  • Related to Feature #13054: Add the ability to filter issues on parent task. added

#46 Updated by Luis Ferrao about 3 years ago

It's been 4 years and innumerable similar requests, this feature is as basic as it gets, what's the hold up?

#47 Updated by Vjacheslav Ryzhov about 3 years ago

Luis Ferrao wrote:

It's been 4 years and innumerable similar requests, this feature is as basic as it gets, what's the hold up?

subscribe to the issue

#50 Updated by Igor Pellegrini almost 3 years ago

+1

Any planned roadmap that could include this feature?
Would really improve my (and others) workflow.

Thanks.

#51 Updated by Daniel Felix almost 3 years ago

Our company uses many issues with many parent tasks. This feature would greatly improve our work with redmine, as we could filter all "master" issues. This would be really great to see this in the next release.

#52 Updated by Mischa The Evil almost 3 years ago

A while ago I started a test of the patch Felix posted in #6118#note-44, therefor I started writing a solid test to back up the rather small code change.
I just finished extracting a patch (using git diff on a local dev branch, so don't mind the SHA's) from the older VM (source:/trunk@13697) I was working on, which includes the change proposed by Felix (although slightly adjusted to match current code [the filter key double quoted, while single quotes work just as fine here]) and an additional test (QueryTest#test_filter_on_parent_task_id) which covers the availability of the filter for issue queries and tests the functionality of each of the operators that are available for integer type filters. With this patch applied (as said on source:/trunk@13697) all existing tests pass (mysql-only, without ldap, scm and ui), as so does the newly added test for this feature.

@Jean-Philippe: can you assess/review this feature and patch to see if it can still be included in 3.0.0? There is obviously a clear demand for this and the change seems rather small and oversee-able, especially now that it includes a test.

#53 Updated by Sebastian Paluch almost 3 years ago

This is great feature but should be done as more complete and include filter by parent task, root task and is leaf. Those are all parent-child relations.

#54 Updated by txemi M almost 3 years ago

+1

I am patching production with Felix's patch, I would love it included in next release.
Useful for views of root tasks or child tasks of given task.

#55 Updated by Jaromír Rys over 2 years ago

+1

#56 Updated by Maik Lindner over 2 years ago

+1

#57 Updated by Florian ROBERT over 2 years ago

+1

#58 Updated by Go MAEDA over 2 years ago

  • Target version changed from Candidate for next major release to 3.1.0

I tested Mischa The Evil's patch on current trunk (r14300) and it works fine.

Could it be in Redmine 3.1.0?

#59 Updated by Jean-Philippe Lang over 2 years ago

  • Subject changed from Filter by parent task to Filter by parent task or subtasks
  • Status changed from New to Closed
  • Resolution set to Fixed

Mischa's patch is nice and simple but it does not address all the posibilities requested here.
I've added 2 filters in r14304 to filter on parent and subtasks (these 2 filters can be combined):

  • parent
    • is XXX (=> lists child issues of XXX)
    • contains XXX (=> lists descendant issues of XXX)
    • none (=> lists root issues)
    • any (=> lists subtasks)
  • subtasks
    • is XXX (=> lists the parent of XXX, maybe not so usefull)
    • contains XXX (=> lists ancestors of XXX)
    • none (=> lists leaf issues)
    • any (=> lists parent issues)

#60 Updated by Go MAEDA over 2 years ago

Thank you very much for implementing this!

#61 Updated by Sebastian Paluch over 2 years ago

That is great, no more plugins!

The only option that seems to be missing under "subtasks" is ability to show issue hierarchy deep to some level. This is useful to see overall list of job to do for a project to some level of details. (#20129)

#62 Updated by Colan Schwartz over 2 years ago

Sebastian Paluch wrote:

The only option that seems to be missing under "subtasks" is ability to show issue hierarchy deep to some level. This is useful to see overall list of job to do for a project to some level of details.

Open another ticket for that (unless there is one already), and link to it from here. Let's not cloud this fixed issue.

#63 Updated by Alex Petty over 2 years ago

Jean-Philippe Lang wrote:

I've added 2 filters in r14304 to filter on parent and subtasks (these 2 filters can be combined):

Excellent!! Thanks Jean-Philippe!!

#64 Updated by Regis Leneveu over 2 years ago

This seems to be the solution for some user-requests in our company.

Could you explain - for the rest of us - HOW I could create a filter which shows a specific tasks an all his related subtasks in a hierarchy?
I just can't figure it ou.

Thanks, Régis

#65 Updated by Toshi MARUYAMA over 1 year ago

  • Related to Feature #22147: Change "Related issues" label for generic grouped query filters added

#66 Updated by Go MAEDA 8 months ago

  • Duplicated by Feature #10763: REST-API: Please add "parent_issue_id" as filter for requests to filter out subtickets added

Also available in: Atom PDF