SearchRTFromFirefox

From Request Tracker Wiki
Jump to navigation Jump to search

Search Plugin

The entries below may still work, but are deprecated. FF2+, and other browsers use another syntax.
See OpenSearchPluginForRT for an up-to-date, single-file solution.

It's quite simple to add a custom search engine to the navigation toolbar of Firefox, Mozilla, or Netscape 6. Complete documentation can be found at the Mozdev site.

You need two files to create the custom search: a file describing how the search should be performed and a 16x16 pixel image to sit alongside the name in your Firefox search drop-down box. In either case below, the action attribute must be modified to reflect the actual URL of your installation.

Search by ID

# RT Ticket id Search by Tim Wilson
 # Created: Jan 19, 2004
 
 <search
  version="7.1"
  name="Request Tracker"
  description="Search RT by ticket number"
  action="http://example.com/Ticket/Display.html"
  method="GET">
  <input name="id" user>
 </search>
 
 

Or, better yet, mimic RT's Simple Search as suggested by StephenFung

<search
 version="7.1"
 name="Request Tracker"
 description="Search RT by ticket number"
 action="http://example.com/index.html"
 method="GET">

 <input name="q" user>
</search>

This file and the graphic go in a folder on your system. e.g; the following for system-wide installations

  • [=/Applications/Firefox.app/Contents/MacOS/searchplugins]
  • C:\Program Files\Mozilla Firefox\searchplugins
  • [=/usr/lib/MozillaFirefox/searchplugins/] (Gentoo)

or similarly named folder in your profile.

Restart your browser and you're ready to go.

To use the search just enter an RT ticket number in the search box. If you're not logged in, RT will prompt you to do so. Once logged in the search should go straight to whatever ticket you enter.

--TimWilson


Keyword Search

I had various trouble getting the above to work awhile ago, and eventually decided it was simpler to use the keyword expansion in the address bar, than to use the navigation facility. If you add a bookmark, with the keyword "rt" and the location "http://rt.example.org/index.html?q=%s" then you can just type "rt <search terms>" into the address bar.

--seph

You can also create specialized searches like the following, which searches the Content:

http://rt.example.com/Search/Results.html?Order=DESC&Query=Content like '%S' &Rows=50&OrderBy=id&Page=1

Simply dissect a normal query and include the segments that you want.

--MichaelErana g33k (at) efamilynj.org