The simple patch below allows you to search on custom fields with the
syntax .fieldName:value.
The : is chosen to match fulltext, although a delimiting = may be
clearer for your users. This was
done so that I could add a "Tags" custom field to queues for free from
annotation & searching
of tickets with relationships that cannot be represented with links
(but perhaps queues, at the
expense of manageability)

--- /tmp/Googleish.pm   2008-09-08 12:37:19.000000000 -0400
+++ lib/RT/Search/Googleish.pm  2008-09-08 12:44:21.000000000 -0400
@@ -141,6 +141,10 @@
             push @owner_clauses, "Owner = '" . $User->Name . "'";
         }

+        elsif ( $key =~ /.(\w+):(\w+)/ ) {
+            push @user_clauses, "CF.{$1} LIKE '$2'";
+        }
+
         # Else, subject must contain $key
         else {
             $key =~ s/['\\].*//g;
[

An earlier incarnation matched /cf.(\w+):(\w+)/i but this seemed
unnecessarily verbose.

The text above has been added to the wiki as SearchCustomField
-- 
Cambridge Energy Alliance: Save money & the planet
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Reply via email to