Defect #4994

Issue global custom fields should be available in filters only for their trackers

Added by Vitaly Klimov almost 13 years ago. Updated almost 13 years ago.

Status:NewStart date:2010-03-05
Priority:LowDue date:
Assignee:Jean-Philippe Lang% Done:


Category:Custom fields
Target version:-
Resolution: Affected version:


Although it is possible to select trackers in which custom fields with for all projects flag set present, those fields available as the filters in the query dialog. Also they are included in the Query.available_columns enumeration.

For example, you have custom field named Type which is required for all projects but only for tracker Bugs. Then you have project Details which does not have tracker Bugs, but custom field type available as filter in this project anyway.

In my code i used following workaround:

def column_exists_for_project?(column, project)
  return true unless (column.is_a?(QueryCustomFieldColumn) && project != nil)

  project.trackers.each do |t|
    t.custom_fields.each do |c|
      return true unless !=

  return false

I am using r3285 of Redmine


#1 Updated by Jean-Philippe Lang almost 13 years ago

  • Priority changed from Normal to Low

#2 Updated by Ryan Bigg almost 13 years ago

May I ask here why you haven't used a detect? It would work in a similar fashion:

    return !!project.trackers.detect do |t|
      t.custom_fields.detect do |c| ==

#3 Updated by Vitaly Klimov almost 13 years ago

Well, because although i have 20+ years experience in C/C++, i quite a novice in Ruby (bumped into it couple of months ago) so, lack of experience here :) Obviously, your code is more elegant.

Also available in: Atom PDF