Defect #25212

User profile should link to issues assigned to user or his groups

Added by Felix Schäfer 5 months ago. Updated about 1 month ago.

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

0%

Category:Issues filter
Target version:3.2.7
Resolution:Fixed Affected version:3.2.0

Description

On the user profile page, the count of the issues assigned to the user includes issues assigned to groups of the user, whereas the query the link points to does only include issues directly assigned to the user.

The link without groups and count on the user profile page: source:/trunk/app/views/users/show.html.erb@16340#L28
The Issue.assigned_to scope specifically including groups: source:/trunk/app/models/issue.rb@16340#L94

A patch to correct this will follow shortly.


Related issues

Related to Redmine - Feature #8153: List assigned issues in user profile page Closed 2011-04-14
Related to Redmine - Defect #13758: Issue Filtering 'Assignee = <<me>>' shows group issues, b... New
Duplicated by Redmine - Defect #26078: List of issues per assignee doesn't match in profile Closed

Associated revisions

Revision 16626
Added by Jean-Philippe Lang about 1 month ago

Link to issues assigned to user or his groups (#25212).

Patch by Felix Schäfer.

History

#1 Updated by Felix Schäfer 5 months ago

This adds the group ids to the linked query:

diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 9bb5d6667..14fa080e0 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -26,7 +26,7 @@
 <h3><%=l(:label_issue_plural)%></h3>
 <ul>
   <li><%= link_to l(:label_assigned_issues),
-        issues_path(:set_filter => 1, :assigned_to_id => @user.id, :sort => 'priority:desc,updated_on:desc') %>:
+        issues_path(:set_filter => 1, :assigned_to_id => ([@user.id] + @user.group_ids).join("|"), :sort => 'priority:desc,updated_on:desc') %>:
       <%= Issue.visible.open.assigned_to(@user).count %>
   <li><%= link_to l(:label_reported_issues),
         issues_path(:set_filter => 1, :status_id => '*', :author_id => @user.id) %>:

A better way would probably be to add the option to also include issues assigned to a user's groups to the issue query, but that's probably a somewhat larger endeavour :-)

#2 Updated by Mischa The Evil about 1 month ago

  • Duplicated by Defect #26078: List of issues per assignee doesn't match in profile added

#3 Updated by Mischa The Evil about 1 month ago

  • Related to Feature #8153: List assigned issues in user profile page added

#4 Updated by Mischa The Evil about 1 month ago

  • Category set to Issues filter
  • Status changed from New to Confirmed
  • Target version set to 3.2.7
  • Affected version changed from 3.3.2 to 3.2.0

Confirmed through #26078:

I wrote:

Confirmed on source:/trunk@16580. The root cause of the issue seems to be #13758 (user groups are ignored when filtering on assigned_to equals user). I see two options:
  1. fix #13758 by also taking into account the user's groups when filtering on assigned_to equals user;
  2. workaround #13758 by changing the used filter (source:/trunk/app/views/users/show.html.erb@16580#L29) to also include the user's groups instead of just the user (multiple filter values).

Thanks for reporting and providing a patch for this. I can confirm that the patch solves the discrepancy.

Felix Schäfer wrote:

[...]
A better way would probably be to add the option to also include issues assigned to a user's groups to the issue query, but that's probably a somewhat larger endeavour :-)

I agree. But I too think that your proposed fix suffices for the time being (ie. until #13758 gets implemented). I'll target this issue for inclusion into 3.2.7.

#5 Updated by Mischa The Evil about 1 month ago

  • Related to Defect #13758: Issue Filtering 'Assignee = <<me>>' shows group issues, but 'Assignee = Bob' does not added

#6 Updated by Jean-Philippe Lang about 1 month ago

  • Subject changed from Discrepancy between assigned to count and linked query on user profile page to User profile should link to issues assigned to user or his groups
  • Status changed from Confirmed to Resolved
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Patch committed, thanks.

#7 Updated by Jean-Philippe Lang about 1 month ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF