From Request Tracker Wiki
Jump to navigation Jump to search

Problem 1

In RT 3.6.x the Simple Search matches tickets regardless of status by default. Older users were used to being able to search for only tickets that were active (New, Open or Stalled). Those that are Resolved or Rejected are, well, completed and not searched for on a regular basis.

Solution 1: Callback

  1. Create your call back directory location mkdir -p /<your-path-to-rt>/rt/local/html/Callbacks/stuff/Search/Simple.html
  2. Put the following code into the file /<your-path-to-rt>/rt/local/html/Callbacks/stuff/Search/Simple.html/ModifyQuery <%init> my $val = $$query; if( $val !~ /new|open|resolved|stalled|rejected|deleted/i ) { $val = "new open stalled $val"; } $$query = $val; </%init> <%args> $query => undef </%args>
  3. Enjoy. -- Dan O'Neill 2008/03/02

Solution 2:

Create local/lib/RT/Search/ with the following

no warnings qw(redefine); # Change the simple search to exclude closed tickets. *orig_QueryToSQL = \&QueryToSQL; *QueryToSQL = sub { my $sql = orig_QueryToSQL(@_); if (!defined $sql) { return $sql; } <code><pre> # Unless the search specifies a status, exclude finished tickets. if ($sql !~ /Status = '/) { $sql .= " AND Status != 'resolved' AND Status != 'rejected'"; } return $sql; </pre></code> };

Tested with RT 3.6.1(Author) & 3.6.4(Ian Goodacre)


If a user searches for a string in Search dialog box in the header and doesn't include status keys in their search, the status' that will be searched are New, Open and Stalled.