<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=SimpleSearchExcludeResolved</id>
	<title>SimpleSearchExcludeResolved - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=SimpleSearchExcludeResolved"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=SimpleSearchExcludeResolved&amp;action=history"/>
	<updated>2026-08-23T02:33:55Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=SimpleSearchExcludeResolved&amp;diff=3645&amp;oldid=prev</id>
		<title>Admin: 2 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=SimpleSearchExcludeResolved&amp;diff=3645&amp;oldid=prev"/>
		<updated>2016-04-06T20:37:46Z</updated>

		<summary type="html">&lt;p&gt;2 revisions imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Problem 1 ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Solution 1: Callback ==&lt;br /&gt;
&lt;br /&gt;
1. Create your call back directory location&lt;br /&gt;
&lt;br /&gt;
 mkdir -p /&amp;amp;lt;your-path-to-rt&amp;amp;gt;/rt/local/html/Callbacks/stuff/Search/Simple.html&lt;br /&gt;
&lt;br /&gt;
2. Put the following code into the file /&amp;amp;lt;your-path-to-rt&amp;amp;gt;/rt/local/html/Callbacks/stuff/Search/Simple.html/ModifyQuery&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;%init&amp;amp;gt;&lt;br /&gt;
 my $val = $$query;&lt;br /&gt;
 &lt;br /&gt;
 if( $val !~ /new|open|resolved|stalled|rejected|deleted/i ) {&lt;br /&gt;
    $val = &amp;quot;new open stalled $val&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
 $$query = $val;&lt;br /&gt;
 &amp;amp;lt;/%init&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;amp;lt;%args&amp;amp;gt;&lt;br /&gt;
 $query =&amp;amp;gt; undef&lt;br /&gt;
 &amp;amp;lt;/%args&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Enjoy. -- Dan O&amp;#039;Neill 2008/03/02&lt;br /&gt;
&lt;br /&gt;
== Solution 2: _Local.pm ==&lt;br /&gt;
&lt;br /&gt;
Create local/lib/RT/Search/[[Googleish Local|Googleish_Local]].pm with the following&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;no warnings qw(redefine);&lt;br /&gt;
 &lt;br /&gt;
 # Change the simple search to exclude closed tickets.&lt;br /&gt;
 &lt;br /&gt;
 *orig_QueryToSQL = \&amp;amp;amp;QueryToSQL;&lt;br /&gt;
 *QueryToSQL = sub {&lt;br /&gt;
     my $sql = orig_QueryToSQL(@_);&lt;br /&gt;
     if (!defined $sql) {&lt;br /&gt;
         return $sql;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     # Unless the search specifies a status, exclude finished tickets.&lt;br /&gt;
 &lt;br /&gt;
     if ($sql !~ /Status = &amp;#039;/) {&lt;br /&gt;
         $sql .= &amp;quot; AND Status != &amp;#039;resolved&amp;#039; AND Status != &amp;#039;rejected&amp;#039;&amp;quot;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     return $sql;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tested with RT 3.6.1(Author) &amp;amp;amp; 3.6.4(Ian Goodacre)&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&lt;br /&gt;
If a user searches for a string in Search dialog box in the header and doesn&amp;#039;t include status keys in their search, the status&amp;#039; that will be searched are New, Open and Stalled.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>