UseRtTool

From Request Tracker Wiki
Jump to navigation Jump to search

bin/rt/ command line tool

$RTHOME/bin/rt is a command line tool that comes with RT. bin/rt can be useful for automating certain RT-related activities: making custom reports, pulling data to feed to other processes, making mass changes to tickets (be careful!), etc. It can both query and update the RT database. bin/rt has its limitations; it cannot deal with custom fields yet (as of January, 2006).

There is no POD (Plain Old Documentation) for the bin/rt tool, but bin/rt has many help pages available by typing bin/rt help.

Telling /bin/rt how to connect

bin/rt talks to your RT web site (not directly to the database) and it needs to know how to connect as if it were a user using a web browser. You can provide connection information either via environment variables or via a configuration file. Define RTUSER to be the RT user name and RTSERVER to be the base URL of your RT web site. E.g.:

export RTUSER=kevin
export RTSERVER=http://127.0.0.1/rt

(syntax is for Bourne-type UNIX shells).

Or create /.rtrc in your home directory and place lines in it like this:

server http://your.rt.server/your_rt_url_path
user   YOUR_RT_USERNAME
passwd YOUR_RT_PASSWORD

By default, bin/rt assumes a server of http://localhost/rt and the same user name as the currently logged-in operating system user.

The user defined above must be a privileged user in your RT instance, i.e. a user who can be granted rights and who has a password. If you don't specify a user, then the operating system user who executes the bin/rt command is used; in this case, the operating system user must also be defined as a privileged user in RT, and the /unix login/ field for that user should be set to the name of the operating system user also. For example, you could have an operating system user named /rt/ and an RT user named /rt/ whose /unix login/ is also /rt/.

Remember that any queries and modifications you perform with the bin/rt command are limited by the permissions of the RT user identity used.

If your web server authenticates in addition to RT itself, place the web server authentication in your server URL, e.g.: http://user:pass@server/rt.

Using bin/rt

Until someone feels like updating this wiki page, refer to the usage documentation available by typing bin/rt help.

Examples<