Feature #1875
open
Issue filtering on author only uses members of project
Added by James Turnbull about 16 years ago.
Updated almost 3 years ago.
Description
We allow non-members of project to add issues and hence they are then authors of the issues they create. The issue filter query only gathers users/authors who are members of the project hence our list of authors to query on is incomplete.
# members of the user's projects
user_values += User.current.projects.collect(&:users).flatten.uniq.sort.collect{|s| [s.name, s.id.to_s] }
Not sure what the best way to fix/address this is...
I have this issue here too. I'd like to see tickets submitted by any user.
But loading thousands of users in the drop-down is not a good solution.
This would require some changes in the Query model and to replace the field with a sort of auto-complete field.
If displaying the list of all users is not a problem for you, you can use:
user_values += User.find(:all).sort.collect{|s| [s.name, s.id.to_s] }
jp jp: Where would I use that?
Understand about the size of the list. Maybe a option setting?
I think you can limit the size of the list by using just those userids that are in the issues for the project/tracker (still could be thousands for a internet wide "public" project)
- Affected version (unused) changed from 0.7.3 to 2.2.2
- Affected version changed from 0.7.3 to 2.2.2
Still able to use see this.
Maybe this could be changed with a simple project setting.
For example:
allow ticket assignment to:
- only project members
- project members + author
- systemwide members (which implies, that assigned to should be a input field with autocomplete, because the list will be too large)
What do you think about this suggestion?
- Tracker changed from Defect to Feature
- Has duplicate Feature #4398: Author Issue-filter only contains members even when non-members have 'create issue' permission added
FTR:
Jean-Philippe Lang wrote at #4398#note-1:
We can not list all users in this field, we need to change this filter to an auto-complete field first.
issues_query.rb
173c177,187
< author_values += users.collect{|s| [s.name, s.id.to_s] }
---
> if project
> from_user = []
> project.issues.group(:author_id).each{|i| from_user << [i.author.name, i.author_id.to_s]}
> from_user.uniq!
> from_user.sort!
> author_values += from_user
> else
> author_values += users.collect{|s| [s.name, s.id.to_s] }
> end
this way works but slow when big amount of issues
(After adding group(:author_id) - works much faster)
173c174,182
< author_values += users.collect{|s| [s.name, s.id.to_s] }
---
> if project
> time_range = (Time.now - (3600*24*180))..(Time.now)
> author_values += project.issues.where(issues: { created_on: time_range }).group(:author_id).preload(:author).collect{|s| [s.author.name, s.author_id.to_s]}
> author_values.sort!
> else
> author_values += users.collect{|s| [s.name, s.id.to_s] }
> end
Another version to work in workflow project, select only authors in last half-year tasks
- Category changed from Issues to Issues filter
- Has duplicate Defect #21075: User without role in project is not shown as a selection option in Author filter (Issues tab) added
+1
This is long waited and reported multiple times. Any chance to get this done?
Another try to solve this issue. for me it's work fine for about 250 active users.
in issue_query.rb after author_values=[]
if project
from_user = []
time_range = (Time.now - (3600*24*730))..(Time.now)
issues_cross = Issue.cross_project_scope(project, 'descendants')
from_user += issues_cross.where(issues: { created_on: time_range }).group(:author_id).preload(:author).collect{|i| [i.author.name, i.author_id.to_s]}
from_user.uniq!
from_user.sort!
author_values += from_user
time_range not required but for me a little helpful...
Also available in: Atom
PDF