%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# %# This software is Copyright (c) 1996-2025 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) %# %# %# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have %# been provided with this software, but in any event can be snarfed %# from www.gnu.org. %# %# This work is distributed in the hope that it will be useful, but %# WITHOUT ANY WARRANTY; without even the implied warranty of %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# %# You should have received a copy of the GNU General Public License %# along with this program; if not, write to the Free Software %# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA %# 02110-1301 or visit their web page on the internet at %# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: %# %# (The following paragraph is not intended to limit the rights granted %# to you to modify and distribute this software under the terms of %# the GNU General Public License and is only of importance to you if %# you choose to contribute your changes and enhancements to the %# community by submitting them to Best Practical Solutions, LLC.) %# %# By intentionally submitting any modifications, corrections or %# derivatives to this work, or any other work intended for use with %# Request Tracker, to Best Practical Solutions, LLC, you confirm that %# you are the copyright holder for those contributions and you grant %# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, %# royalty-free, perpetual, license to use, copy, create derivative %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => $title &> <& /Elements/Tabs &> % $m->callback( %ARGS, CallbackName => 'PreForm' );
<&|/l&>Simple Search Help

<&|/l&>Ticket simple search is available above, and in the menu bar at the top of every page. This search box accepts various keywords followed by a colon to refine your search. These options are described below.

% if ( $config->{'Enable'} && $config->{'Indexed'} ) { <&|/l&>Any word not matching a keyword is searched for in the ticket transaction history. % } % else { <&|/l&>Any word not matching a keyword is searched for in ticket subjects. % }

% if ( $config->{'Enable'} ) { % }
<% loc('Ticket search field') %> <% loc('Examples') %>
id <% loc('Enter a ticket id. Takes you directly to the ticket.') %>

12345

id:12345

subject

<&|/l_unsafe, 'subject:' &>Enter [_1] followed by the search value.

<% loc('If the search value contains spaces, enclose it in quotes.') %>

% unless ( $config->{'Enable'} && $config->{'Indexed'} ) { <&|/l&>Also, any word not matching a keyword is searched for in ticket subjects. % }

subject:avacado

subject:"ripe avacado"

history % if ( $config->{'Indexed'} ) {

<&|/l, $fulltext_keyword &>Search for any word in the ticket transaction history by typing [_1]word.

% } % else {

<&|/l, $fulltext_keyword &>Searching the full text of every ticket can take a long time, but if you need to do it, you can search for any word in full ticket history by typing [_1]word.

% }

<&|/l, $fulltext_keyword &>Search for multiple words by enclosing the words in quotes [_1]"multiple search words".

% if ( $config->{'Enable'} && $config->{'Indexed'} ) { <&|/l&>Also, any word not matching a keyword is searched for in ticket history. % }

fulltext:coffee

fulltext:"need coffee"

queue

<% loc('Enter a queue name.') %>

<&|/l_unsafe, 'queue:' &>If the queue name contains spaces, enter [_1] followed by the queue name in quotes.

General

queue:"IT Support"

owner <% loc("Enter an RT username.") %>

jsmith

owner:jsmith

requestor <% loc('Enter an email address.') %>

jsmith@example.com

requestor:jsmith@example.com

status

<&|/l_unsafe, map { "$_" } qw(initial active inactive any) &>Add [_1], [_2], [_3], or [_4] to the end of a search to limit results to tickets with matching statuses.

status:any

subject:avacado open

owner:jsmith active

custom field

<&|/l_unsafe, 'cf.Name:' &>Enter [_1] followed by the search value.

<% loc('If the custom field name or the search value have spaces, enclose them in quotes.') %>

cf.Color:blue

cf."Favorite Color":"hunter green"

email domain <% loc('To search for tickets with watchers who match a domain, enter the domain, including the @ symbol.') %>

@example.com

domain:@example.com

% if (RT->Config->Get('OnlySearchActiveTicketsInSimpleSearch', $session{'CurrentUser'})) { % my $status_str = join ', ', map { loc($_) } RT::Queue->ActiveStatusArray; <&|/l, $status_str &>By default, tickets with active statuses ([_1]) are searched. % }

<&|/l_unsafe, 'queue:"Queue Name" open', 'queue:"Queue Name" active' &>To search on a specific status, add it to the end of any other search, as in [_1] or [_2]. See "status" above for examples.

% my $link_start = ''; % my $link_end = '';

<&|/l_unsafe, $link_start, $link_end &>For the full power of RT's searches, use the [_1]query builder[_2].

% $m->callback( %ARGS, CallbackName => 'PostForm' );
<%INIT> my $title = loc("Search for tickets"); use RT::Search::Simple; my $config = RT->Config->Get('FullTextSearch') || {}; my $fulltext_keyword = 'fulltext:'; if ($q) { my $tickets = RT::Tickets->new( $session{'CurrentUser'} ); $m->callback( %ARGS, query => \$q, CallbackName => 'ModifyQuery' ); if ($q =~ /^#?(\d+)$/) { RT::Interface::Web::Redirect(RT->Config->Get('WebURL')."Ticket/Display.html?id=".$1); } my %args = ( Argument => $q, TicketsObj => $tickets, ); $m->callback( %ARGS, CallbackName => 'SearchArgs', args => \%args); my $search = RT::Search::Simple->new(%args); my $query = $m->comp('/Elements/QueryString', %ARGS, Query => $search->QueryToSQL() ); my $result_path = RT->Config->Get('WebURL') . "Search/Results.html?$query"; RT::Interface::Web::Redirect( $result_path ); $m->abort(); } <%ARGS> $q => undef