Project

General

Profile

Actions

Defect #25212

closed

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

Added by Felix Schäfer about 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Category:
Issues filter
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

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 pageClosed2011-04-14

Actions
Related to Redmine - Defect #13758: Issue Filtering 'Assignee = <<me>>' shows group issues, but 'Assignee = Bob' does notNew

Actions
Has duplicate Redmine - Defect #26078: List of issues per assignee doesn't match in profileClosed

Actions
Actions #1

Updated by Felix Schäfer about 7 years 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 :-)

Actions #2

Updated by Mischa The Evil almost 7 years ago

  • Has duplicate Defect #26078: List of issues per assignee doesn't match in profile added
Actions #3

Updated by Mischa The Evil almost 7 years ago

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

Updated by Mischa The Evil almost 7 years 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.

Actions #5

Updated by Mischa The Evil almost 7 years ago

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

Updated by Jean-Philippe Lang almost 7 years 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.

Actions #7

Updated by Jean-Philippe Lang almost 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF