<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rt-wiki.bestpractical.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jbrandt</id>
	<title>Request Tracker Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://rt-wiki.bestpractical.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jbrandt"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/wiki/Special:Contributions/Jbrandt"/>
	<updated>2026-08-23T06:52:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=InstallationGuides&amp;diff=27242</id>
		<title>InstallationGuides</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=InstallationGuides&amp;diff=27242"/>
		<updated>2025-07-17T12:22:34Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: /* The best/easiest distribution for RT */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Picking a Linux Distribution=&lt;br /&gt;
&lt;br /&gt;
RT runs on Arch Linux, Debian, FreeBSD, NetBSD, RHEL, Fedora, Solaris, SuSE, Gentoo, OpenBSD, and more. If you maintain other Linux systems, it&#039;s best to stick with the Linux you have the most experience with. If you&#039;re just starting and don&#039;t have a preference, it&#039;s safe to use Linux distributions based on either Debian or Red Hat, where you&#039;ll find guides (including Fedora, and Ubuntu). The [[ManualInstallation]] page had details on installation steps.&lt;br /&gt;
&lt;br /&gt;
= Generic Installation Guides =&lt;br /&gt;
&lt;br /&gt;
* [[ManualRequirements]] - software and knowledge you need to install RT.&lt;br /&gt;
* [[ManualInstallation]] - general overview of installation process and first time configuring.&lt;br /&gt;
* [[DevelopmentInstallation]] - HOWTO setup RT to run from a development directory&lt;br /&gt;
* [http://www.sgsosu.net/nmetro/docs.html Installation and Administration Guides] - Request Tracker, Reporting and Asset Tracker&lt;br /&gt;
&lt;br /&gt;
= Platform-Specific Installation Guides =&lt;br /&gt;
&lt;br /&gt;
* Arch Linux&lt;br /&gt;
** [https://wiki.archlinux.org/index.php/Request_Tracker Request Tracker (Arch Wiki)]&lt;br /&gt;
* CentOS:&lt;br /&gt;
** [[CentOS7Install]] (CentOS 7.2.1511 install using Perl RPMs and CPANminus to source CPAN dependencies)&lt;br /&gt;
* [[SuSE|SUSE Linux Enterprise (SLE):]]&lt;br /&gt;
** [[SLES11InstallGuide]]&lt;br /&gt;
&lt;br /&gt;
= Database Specific Notes =&lt;br /&gt;
&lt;br /&gt;
* [[OracleSetup]]&lt;br /&gt;
* RT with [[OracleText]]&lt;br /&gt;
* RT with [[PostgreSQLFullText]]&lt;br /&gt;
* RT with [[PostgreSQLFullTextTrgm]]&lt;br /&gt;
&lt;br /&gt;
= Web Server Specific Notes =&lt;br /&gt;
&lt;br /&gt;
* [[LighttpdFastCGIGuide]]&lt;br /&gt;
&lt;br /&gt;
= Upgrading =&lt;br /&gt;
&lt;br /&gt;
* [[MigrateToNewServer]]&lt;br /&gt;
* [[UpgradingFrom3011To344OnSolaris9]]&lt;br /&gt;
* [[Upgrade_RT_3.6.7_to_3.8.8_-_Debian_5.0(lenny)_to_6.0(squeeze)]]&lt;br /&gt;
&lt;br /&gt;
= Other =&lt;br /&gt;
&lt;br /&gt;
* [[CompilingPerl]]&lt;br /&gt;
* [[ManualApache]]&lt;br /&gt;
* [[InstallMailgateOnly]]&lt;br /&gt;
&lt;br /&gt;
= Deployment guides =&lt;br /&gt;
&lt;br /&gt;
Documents which explain why and which way, rather than how.&lt;br /&gt;
&lt;br /&gt;
* [[ItsFinallyInstalledNowWhat]]&lt;br /&gt;
* The [http://web.mit.edu/tooltime/ MITProjectNotebook], especially the [http://web.mit.edu/tooltime/notebook/reference/documentation.html Documentation page], which includes a [http://web.mit.edu/tooltime/notebook/reference/rtbasics.pdf 15 page PDF] User&#039;s Manual.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=SiteConfig&amp;diff=27241</id>
		<title>SiteConfig</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=SiteConfig&amp;diff=27241"/>
		<updated>2025-06-25T12:26:40Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: /* Plugins */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What It Is =&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;SiteConfig&#039;&#039;&#039; file lives in &amp;lt;code&amp;gt;${RTHOME}/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;. Its purpose is to provide you a place to override config settings in &amp;lt;code&amp;gt;${RTHOME}/etc/RT_Config.pm&amp;lt;/code&amp;gt; as well as add new config variables as provided by various user [[Contributions]] or for your own purposes.&lt;br /&gt;
&lt;br /&gt;
All of the available configuration options are documented in RT_Config.pm and also [http://bestpractical.com/rt/docs/latest/RT_Config.html available on the web].&lt;br /&gt;
&lt;br /&gt;
You set a config variable like so:&lt;br /&gt;
&lt;br /&gt;
 Set($Foo, &amp;quot;Value of Foo&amp;quot;);&lt;br /&gt;
 Set($Bar, 1);&lt;br /&gt;
 Set(@Baz, &amp;quot;array&amp;quot;, &amp;quot;of&amp;quot;, &amp;quot;values&amp;quot;);&lt;br /&gt;
 Set(%Zot, &amp;quot;hash&amp;quot; =&amp;amp;gt; &amp;quot;of&amp;quot;, &amp;quot;keyed&amp;quot; =&amp;amp;gt; &amp;quot;values&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
You access them like this in RT 3.8 and newer:&lt;br /&gt;
&lt;br /&gt;
 RT-&amp;amp;gt;Config-&amp;amp;gt;Get(&#039;Foo&#039;) # &amp;quot;Value of option Foo&amp;quot;&lt;br /&gt;
 RT-&amp;amp;gt;Config-&amp;amp;gt;Get(&#039;Bar&#039;)  # 1&lt;br /&gt;
 RT-&amp;amp;gt;Config-&amp;amp;gt;Get(&#039;Baz&#039;)-&amp;amp;gt;[0] # get option Baz that is array reference and access first element&lt;br /&gt;
&lt;br /&gt;
= Plugins =&lt;br /&gt;
&lt;br /&gt;
Enable extensions, also called plugins, with a &amp;lt;code&amp;gt;Plugin&amp;lt;/code&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
    Plugin(&#039;RT::Extension::ResetPassword&#039;);&lt;br /&gt;
    Plugin(&#039;RT::Extension::Helpdesk&#039;);&lt;br /&gt;
&lt;br /&gt;
Use one line for each plugin.&lt;br /&gt;
&lt;br /&gt;
RT before version 4 used syntax like this:&lt;br /&gt;
&lt;br /&gt;
    Set(@Plugins, qw(Extension::QuickDelete));&lt;br /&gt;
&lt;br /&gt;
When upgrading, convert to the &amp;lt;code&amp;gt;Plugin&amp;lt;/code&amp;gt; form shown above.&lt;br /&gt;
&lt;br /&gt;
==Custom Statuses==&lt;br /&gt;
&lt;br /&gt;
RT 4 and after use the [http://bestpractical.com/rt/docs/latest/customizing/lifecycles.html Lifecycles] system to define custom statuses, workflows, actions, and more.&lt;br /&gt;
&lt;br /&gt;
RT 3.8 and prior used configuration values to define [[CustomStatuses]].&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=SiteConfig&amp;diff=27240</id>
		<title>SiteConfig</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=SiteConfig&amp;diff=27240"/>
		<updated>2025-06-25T12:24:53Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: /* Plugins and Extensions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What It Is =&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;SiteConfig&#039;&#039;&#039; file lives in &amp;lt;code&amp;gt;${RTHOME}/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;. Its purpose is to provide you a place to override config settings in &amp;lt;code&amp;gt;${RTHOME}/etc/RT_Config.pm&amp;lt;/code&amp;gt; as well as add new config variables as provided by various user [[Contributions]] or for your own purposes.&lt;br /&gt;
&lt;br /&gt;
All of the available configuration options are documented in RT_Config.pm and also [http://bestpractical.com/rt/docs/latest/RT_Config.html available on the web].&lt;br /&gt;
&lt;br /&gt;
You set a config variable like so:&lt;br /&gt;
&lt;br /&gt;
 Set($Foo, &amp;quot;Value of Foo&amp;quot;);&lt;br /&gt;
 Set($Bar, 1);&lt;br /&gt;
 Set(@Baz, &amp;quot;array&amp;quot;, &amp;quot;of&amp;quot;, &amp;quot;values&amp;quot;);&lt;br /&gt;
 Set(%Zot, &amp;quot;hash&amp;quot; =&amp;amp;gt; &amp;quot;of&amp;quot;, &amp;quot;keyed&amp;quot; =&amp;amp;gt; &amp;quot;values&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
You access them like this in RT 3.8 and newer:&lt;br /&gt;
&lt;br /&gt;
 RT-&amp;amp;gt;Config-&amp;amp;gt;Get(&#039;Foo&#039;) # &amp;quot;Value of option Foo&amp;quot;&lt;br /&gt;
 RT-&amp;amp;gt;Config-&amp;amp;gt;Get(&#039;Bar&#039;)  # 1&lt;br /&gt;
 RT-&amp;amp;gt;Config-&amp;amp;gt;Get(&#039;Baz&#039;)-&amp;amp;gt;[0] # get option Baz that is array reference and access first element&lt;br /&gt;
&lt;br /&gt;
= Plugins =&lt;br /&gt;
&lt;br /&gt;
Enable extensions, also called plugins, with a `Plugin` line.&lt;br /&gt;
&lt;br /&gt;
    Plugin(&#039;RT::Extension::ResetPassword&#039;);&lt;br /&gt;
    Plugin(&#039;RT::Extension::Helpdesk&#039;);&lt;br /&gt;
&lt;br /&gt;
Use one line for each plugin.&lt;br /&gt;
&lt;br /&gt;
RT before version 4 used syntax like this:&lt;br /&gt;
&lt;br /&gt;
    Set(@Plugins, qw(Extension::QuickDelete));&lt;br /&gt;
&lt;br /&gt;
When upgrading, convert to the `Plugin` form shown above.&lt;br /&gt;
&lt;br /&gt;
==Custom Statuses==&lt;br /&gt;
&lt;br /&gt;
RT 4 and after use the [http://bestpractical.com/rt/docs/latest/customizing/lifecycles.html Lifecycles] system to define custom statuses, workflows, actions, and more.&lt;br /&gt;
&lt;br /&gt;
RT 3.8 and prior used configuration values to define [[CustomStatuses]].&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27133</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27133"/>
		<updated>2022-12-20T16:13:36Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
RT&#039;s [https://docs.bestpractical.com/rt/latest/README.html README] for the version you are installing is the best starting resource. It provides the high-level steps to follow, but not details. This guide provides some of those details. It is not meant to be followed step by step, but it does provide guidance once you have picked the database and web server you want to use for RT.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Debian/Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz multiwatch openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat Enterprise Linux ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for RHEL specifically. For RHEL-derived distributions like CentOS and Rocky, go to the next section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;MAJDISTVER=&amp;quot;$(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;${VERSION_ID%%.*}&amp;quot;)&amp;quot;&lt;br /&gt;
sudo subscription-manager repos --enable &amp;quot;codeready-builder-for-rhel-$MAJDISTVER-$(arch)-rpms&amp;quot;&lt;br /&gt;
sudo dnf install &amp;quot;https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJDISTVER.noarch.rpm&amp;quot;&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
=== RHEL Community Distributions: Fedora/CentOS/Rocky ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install epel-release&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports MySQL, MariaDB, Postgresql, and Oracle, and SQLite for development. Currently MariaDB and Postgreql are easiest to get and install via most Linux packaging systems.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing RT.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|On latest versions:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-connector-c-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you&#039;re on an older version that doesn&#039;t have that package:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Optional: Create RT system accounts ===&lt;br /&gt;
&lt;br /&gt;
Creating separate RT system accounts is optional. Running configure will usually auto detect the correct group and user to use for setting permissions. See the [https://docs.bestpractical.com/rt/latest/configure.html group and user related options for configure] to fine tune the permissions.&lt;br /&gt;
&lt;br /&gt;
You can create this user and group if you prefer not to install as root. This account will be used throughout the install process to control access to sensitive files. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo groupadd --system rt&lt;br /&gt;
sudo useradd --system --home-dir=/opt/rt5/var --gid=rt rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.3.tar.gz&lt;br /&gt;
tar -xf rt-5.0.3.tar.gz&lt;br /&gt;
cd rt-5.0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
The [https://docs.bestpractical.com/rt/latest/configure.html configure] command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-web-user=rt --with-web-group=rt&amp;lt;/code&amp;gt; installs RT using the dedicated accounts we created earlier.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory. As an example of manually setting serveral options, you can run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-web-user=rt --with-web-group=rt --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many of the values have default settings, like /opt/rt5 as the prefix. And the configure script will try to find things like the configured &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt;, so this can also work for a fairly typical RT:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --enable-gd --enable-graphviz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. RT has [https://docs.bestpractical.com/rt/latest/rt_perl.html additional documentation] on setting up your perl. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory. To install the modules in the standard perl directories, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to install the perl libraries in the RT directories, you could run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
# WebPath is the path where the RT web server runs on your WebDomain.&lt;br /&gt;
# Edit the path below only if you&#039;re using a specific path like example.com/rt&lt;br /&gt;
Set($WebPath, &#039;/rt&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, if you log to syslog, it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
# Some syslogs log only warn and error, so lower levels like debug won&#039;t appear here.&lt;br /&gt;
Set($LogToSyslog, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that will go to the rt-server journal.&lt;br /&gt;
# Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
# When running with Apache, these logs will go to the Apache error log,&lt;br /&gt;
# which should be set up with logrotate automatically.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;, so run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make initialize-database&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That runs the &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; command for you. If you&#039;re curious, you can see all of the options in [https://docs.bestpractical.com/rt/latest/rt-setup-database.html RT&#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database administrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.3&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is done as part of the installation, so permissions should be correct, but this is helpful if you change something.&lt;br /&gt;
&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
Fully documenting how to set up a web server configured for your network, with SSL, is outside the scope of this guide. This page only highlights the configuration you need to pass web requests onto RT using Apache with mod_fcgid or nginx and the RT FastCGI service.&lt;br /&gt;
&lt;br /&gt;
See the [https://docs.bestpractical.com/rt/latest/web_deployment.html RT deployment guide] for the latest recommendations from Best Practical on how to deploy RT.&lt;br /&gt;
&lt;br /&gt;
=== Apache httpd ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed, are using the [https://docs.bestpractical.com/rt/latest/web_deployment.html#prefork-MPM preform MPM], and the mod_fcgid module is enabled:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&lt;br /&gt;
sudo a2dismod mpm_event&lt;br /&gt;
sudo a2dismod mpm_worker&lt;br /&gt;
sudo systemctl restart apache2&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo systemctl restart apache2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ScriptAlias&amp;lt;/code&amp;gt; lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Optional apache logs for RT&lt;br /&gt;
# Ensure that your log rotation scripts know about these files&lt;br /&gt;
# ErrorLog /opt/rt5/var/log/apache2.error&lt;br /&gt;
# TransferLog /opt/rt5/var/log/apache2.access&lt;br /&gt;
# LogLevel debug&lt;br /&gt;
&lt;br /&gt;
AddDefaultCharset UTF-8&lt;br /&gt;
&lt;br /&gt;
# ScriptAlias and Location should match RT&#039;s WebPath&lt;br /&gt;
&lt;br /&gt;
# If WebPath is empty then use a single slash:&lt;br /&gt;
ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
# If WebPath is &#039;rt&#039; then add that after the slash:&lt;br /&gt;
# ScriptAlias /rt /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&lt;br /&gt;
DocumentRoot &amp;quot;/opt/rt5/share/html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# If WebPath is empty then use a single slash:&lt;br /&gt;
&amp;lt;Location /&amp;gt;&lt;br /&gt;
# If WebPath is &#039;rt&#039; then add that after the slash:&lt;br /&gt;
# &amp;lt;Location /rt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
&amp;lt;/Location&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration location varies by distribution and whether or not you&#039;re using HTTPS:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/apache2/sites-available/default-ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: &amp;lt;code&amp;gt;/etc/apache2/sites-available/000-default.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/httpd/conf.d/ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: Write a new file &amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== nginx ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RT FastCGI service for use with nginx ====&lt;br /&gt;
&lt;br /&gt;
===== Create the RT service =====&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.service&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT service to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
# The --forks option is the number of RT servers to run in parallel.&lt;br /&gt;
# 3 should be good for most initial installs. You can increase this&lt;br /&gt;
# number later if needed for performance.&lt;br /&gt;
ExecStart=/usr/bin/multiwatch --forks=3 --signal=TERM -- /opt/rt5/sbin/rt-server.fcgi&lt;br /&gt;
StandardInput=socket&lt;br /&gt;
User=rt&lt;br /&gt;
UMask=027&lt;br /&gt;
&lt;br /&gt;
CapabilityBoundingSet=&lt;br /&gt;
DevicePolicy=closed&lt;br /&gt;
PrivateMounts=true&lt;br /&gt;
PrivateNetwork=false&lt;br /&gt;
PrivateTmp=true&lt;br /&gt;
PrivateUsers=true&lt;br /&gt;
ProtectControlGroups=true&lt;br /&gt;
ProtectHome=true&lt;br /&gt;
ProtectSystem=full&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
===== Create the RT socket =====&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT socket to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server socket&lt;br /&gt;
Wants=network.target&lt;br /&gt;
After=network.target&lt;br /&gt;
Before=apache2.service httpd.service nginx.service&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
[Socket]&lt;br /&gt;
# ListenStream defines the address and port where the RT FastCGI server listens.&lt;br /&gt;
# This is NOT the web server itself, so don&#039;t make this port 80, 443, etc.&lt;br /&gt;
# You may edit this if you like, but note:&lt;br /&gt;
# Connections are unencrypted. You should only listen on a secure network&lt;br /&gt;
# interface.&lt;br /&gt;
# The server can only accept a single socket. You cannot specify more than&lt;br /&gt;
# one ListenStream address.&lt;br /&gt;
ListenStream=[::1]:5000&lt;br /&gt;
Accept=no&lt;br /&gt;
FreeBind=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
===== Enable the RT socket =====&lt;br /&gt;
&lt;br /&gt;
Start the server socket and enable it on future boots:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl enable --now rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The location path should match the WebPath in your RT site configuration.&lt;br /&gt;
location / {&lt;br /&gt;
  include /etc/nginx/fastcgi.conf;&lt;br /&gt;
  # SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
  # This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
  fastcgi_param SCRIPT_NAME &amp;quot;&amp;quot;;&lt;br /&gt;
  # This network location should match the ListenStream in rt-server.socket.&lt;br /&gt;
  fastcgi_pass localhost:5000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration location varies by distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|Edit &amp;lt;code&amp;gt;/etc/nginx/sites-available/default&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add a new file &amp;lt;code&amp;gt;/etc/nginx/default.d/rt-server.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to Verify the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If the web server returns a 502 Bad Gateway response, it&#039;s having trouble connecting to the RT FCGI server. Check the error logs for your web server:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|nginx&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|Apache on Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|httpd on Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/nginx/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/httpd/error_log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For all kinds of errors, you can check the logs for the RT FCGI server and its socket:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo journalctl --unit rt-server.\*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It does not connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command, which is provided by whichever MTA you have installed (postfix, sendmail, exim, qmail, etc.). There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like msmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, install the [https://metacpan.org/pod/RT::Client::CLI RT::Client::CLI] Perl package on the mail server. For example, you could install cpanminus, then run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cpanm --sudo RT::Client::CLI&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   rt    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
1   *   *   *   *   rt    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
50  3   *   *   *   rt    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon rt    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   rt    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27132</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27132"/>
		<updated>2022-12-20T14:55:31Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
RT&#039;s [https://docs.bestpractical.com/rt/latest/README.html README] for the version you are installing is the best starting resource. It provides the high-level steps to follow, but not details. This guide provides some of those details. It is not meant to be followed step by step, but it does provide guidance once you have picked the database and web server you want to use for RT.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Debian/Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz multiwatch openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat Enterprise Linux ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for RHEL specifically. For RHEL-derived distributions like CentOS and Rocky, go to the next section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;MAJDISTVER=&amp;quot;$(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;${VERSION_ID%%.*}&amp;quot;)&amp;quot;&lt;br /&gt;
sudo subscription-manager repos --enable &amp;quot;codeready-builder-for-rhel-$MAJDISTVER-$(arch)-rpms&amp;quot;&lt;br /&gt;
sudo dnf install &amp;quot;https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJDISTVER.noarch.rpm&amp;quot;&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
=== RHEL Community Distributions: Fedora/CentOS/Rocky ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install epel-release&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports MySQL, MariaDB, Postgresql, and Oracle, and SQLite for development. Currently MariaDB and Postgreql are easiest to get and install via most Linux packaging systems.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing RT.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|On latest versions:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-connector-c-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you&#039;re on an older version that doesn&#039;t have that package:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Optional: Create RT system accounts ===&lt;br /&gt;
&lt;br /&gt;
Creating separate RT system accounts is optional. Running configure will usually auto detect the correct group and user to use for setting permissions. See the [https://docs.bestpractical.com/rt/latest/configure.html group and user related options for configure] to fine tune the permissions.&lt;br /&gt;
&lt;br /&gt;
You can create this user and group if you prefer not to install as root. This account will be used throughout the install process to control access to sensitive files. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo groupadd --system rt&lt;br /&gt;
sudo useradd --system --home-dir=/opt/rt5/var --gid=rt rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.3.tar.gz&lt;br /&gt;
tar -xf rt-5.0.3.tar.gz&lt;br /&gt;
cd rt-5.0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
The [https://docs.bestpractical.com/rt/latest/configure.html configure] command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-web-user=rt --with-web-group=rt&amp;lt;/code&amp;gt; installs RT using the dedicated accounts we created earlier.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory. As an example of manually setting serveral options, you can run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-web-user=rt --with-web-group=rt --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many of the values have default settings, like /opt/rt5 as the prefix. And the configure script will try to find things like the configured &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt;, so this can also work for a fairly typical RT:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --enable-gd --enable-graphviz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. RT has [https://docs.bestpractical.com/rt/latest/rt_perl.html additional documentation] on setting up your perl. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory. To install the modules in the standard perl directories, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to install the perl libraries in the RT directories, you could run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
# WebPath is the path where the RT web server runs on your WebDomain.&lt;br /&gt;
# Edit the path below only if you&#039;re using a specific path like example.com/rt&lt;br /&gt;
Set($WebPath, &#039;/rt&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, if you log to syslog, it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
# Some syslogs log only warn and error, so lower levels like debug won&#039;t appear here.&lt;br /&gt;
Set($LogToSyslog, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that will go to the rt-server journal.&lt;br /&gt;
# Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
# When running with Apache, these logs will go to the Apache error log,&lt;br /&gt;
# which should be set up with logrotate automatically.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;, so run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make initialize-database&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That runs the &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; command for you. If you&#039;re curious, you can see all of the options in [https://docs.bestpractical.com/rt/latest/rt-setup-database.html RT&#039;s documentation].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database administrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.3&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
Fully documenting how to set up a web server configured for your network with encryption is outside the scope of this guide. This page only highlights the configuration you need to pass web requests onto RT using Apache with mod_fcgid or nginx and the RT FastCGI service.&lt;br /&gt;
&lt;br /&gt;
See the [https://docs.bestpractical.com/rt/latest/web_deployment.html RT deployment guide] for the latest recommendations from Best Practical on how to deploy RT.&lt;br /&gt;
&lt;br /&gt;
=== Apache httpd ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed, are using the [https://docs.bestpractical.com/rt/latest/web_deployment.html#prefork-MPM preform MPM], and the mod_fcgid module is enabled:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&lt;br /&gt;
sudo a2dismod mpm_event&lt;br /&gt;
sudo a2dismod mpm_worker&lt;br /&gt;
sudo systemctl restart apache2&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo systemctl restart apache2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ScriptAlias&amp;lt;/code&amp;gt; lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Optional apache logs for RT&lt;br /&gt;
# Ensure that your log rotation scripts know about these files&lt;br /&gt;
# ErrorLog /opt/rt5/var/log/apache2.error&lt;br /&gt;
# TransferLog /opt/rt5/var/log/apache2.access&lt;br /&gt;
# LogLevel debug&lt;br /&gt;
&lt;br /&gt;
AddDefaultCharset UTF-8&lt;br /&gt;
&lt;br /&gt;
# ScriptAlias and Location should match RT&#039;s WebPath&lt;br /&gt;
&lt;br /&gt;
# If WebPath is empty then use a single slash:&lt;br /&gt;
ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
# If WebPath is &#039;rt&#039; then add that after the slash:&lt;br /&gt;
# ScriptAlias /rt /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&lt;br /&gt;
DocumentRoot &amp;quot;/opt/rt5/share/html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# If WebPath is empty then use a single slash:&lt;br /&gt;
&amp;lt;Location /&amp;gt;&lt;br /&gt;
# If WebPath is &#039;rt&#039; then add that after the slash:&lt;br /&gt;
# &amp;lt;Location /rt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
&amp;lt;/Location&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration location varies by distribution and whether or not you&#039;re using HTTPS:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/apache2/sites-available/default-ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: &amp;lt;code&amp;gt;/etc/apache2/sites-available/000-default.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/httpd/conf.d/ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: Write a new file &amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== nginx ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RT FastCGI service for use with nginx ====&lt;br /&gt;
&lt;br /&gt;
===== Create the RT service =====&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.service&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT service to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
# The --forks option is the number of RT servers to run in parallel.&lt;br /&gt;
# 3 should be good for most initial installs. You can increase this&lt;br /&gt;
# number later if needed for performance.&lt;br /&gt;
ExecStart=/usr/bin/multiwatch --forks=3 --signal=TERM -- /opt/rt5/sbin/rt-server.fcgi&lt;br /&gt;
StandardInput=socket&lt;br /&gt;
User=rt&lt;br /&gt;
UMask=027&lt;br /&gt;
&lt;br /&gt;
CapabilityBoundingSet=&lt;br /&gt;
DevicePolicy=closed&lt;br /&gt;
PrivateMounts=true&lt;br /&gt;
PrivateNetwork=false&lt;br /&gt;
PrivateTmp=true&lt;br /&gt;
PrivateUsers=true&lt;br /&gt;
ProtectControlGroups=true&lt;br /&gt;
ProtectHome=true&lt;br /&gt;
ProtectSystem=full&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
===== Create the RT socket =====&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT socket to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server socket&lt;br /&gt;
Wants=network.target&lt;br /&gt;
After=network.target&lt;br /&gt;
Before=apache2.service httpd.service nginx.service&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
[Socket]&lt;br /&gt;
# ListenStream defines the address and port where the RT FastCGI server listens.&lt;br /&gt;
# This is NOT the web server itself, so don&#039;t make this port 80, 443, etc.&lt;br /&gt;
# You may edit this if you like, but note:&lt;br /&gt;
# Connections are unencrypted. You should only listen on a secure network&lt;br /&gt;
# interface.&lt;br /&gt;
# The server can only accept a single socket. You cannot specify more than&lt;br /&gt;
# one ListenStream address.&lt;br /&gt;
ListenStream=[::1]:5000&lt;br /&gt;
Accept=no&lt;br /&gt;
FreeBind=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
===== Enable the RT socket =====&lt;br /&gt;
&lt;br /&gt;
Start the server socket and enable it on future boots:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl enable --now rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The location path should match the WebPath in your RT site configuration.&lt;br /&gt;
location / {&lt;br /&gt;
  include /etc/nginx/fastcgi.conf;&lt;br /&gt;
  # SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
  # This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
  fastcgi_param SCRIPT_NAME &amp;quot;&amp;quot;;&lt;br /&gt;
  # This network location should match the ListenStream in rt-server.socket.&lt;br /&gt;
  fastcgi_pass localhost:5000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration location varies by distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|Edit &amp;lt;code&amp;gt;/etc/nginx/sites-available/default&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add a new file &amp;lt;code&amp;gt;/etc/nginx/default.d/rt-server.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to Verify the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If the web server returns a 502 Bad Gateway response, it&#039;s having trouble connecting to the RT FCGI server. Check the error logs for your web server:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|nginx&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|Apache on Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|httpd on Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/nginx/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/httpd/error_log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For all kinds of errors, you can check the logs for the RT FCGI server and its socket:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo journalctl --unit rt-server.\*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like msmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, install the [https://metacpan.org/pod/RT::Client::CLI RT::Client::CLI] Perl package on the mail server. For example, you could install cpanminus, then run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cpanm --sudo RT::Client::CLI&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   rt    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
1   *   *   *   *   rt    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
50  3   *   *   *   rt    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon rt    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   rt    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27131</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27131"/>
		<updated>2022-12-20T14:30:05Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
RT&#039;s [https://docs.bestpractical.com/rt/latest/README.html README] for the version you are installing is the best starting resource. It provides the high-level steps to follow, but not details. This guide provides some of those details. It is not meant to be followed step by step, but it does provide guidance once you have picked the database and web server you want to use for RT.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Debian/Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz multiwatch openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat Enterprise Linux ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for RHEL specifically. For RHEL-derived distributions like CentOS and Rocky, go to the next section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;MAJDISTVER=&amp;quot;$(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;${VERSION_ID%%.*}&amp;quot;)&amp;quot;&lt;br /&gt;
sudo subscription-manager repos --enable &amp;quot;codeready-builder-for-rhel-$MAJDISTVER-$(arch)-rpms&amp;quot;&lt;br /&gt;
sudo dnf install &amp;quot;https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJDISTVER.noarch.rpm&amp;quot;&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
=== RHEL Community Distributions: Fedora/CentOS/Rocky ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install epel-release&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports MySQL, MariaDB, Postgresql, and Oracle, and SQLite for development. Currently MariaDB and Postgreql are easiest to get and install via most Linux packaging systems.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing RT.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|On latest versions:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-connector-c-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you&#039;re on an older version that doesn&#039;t have that package:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Optional: Create RT system accounts ===&lt;br /&gt;
&lt;br /&gt;
Creating separate RT system accounts is optional. Running configure will usually auto detect the correct group and user to use for setting permissions. See the [https://docs.bestpractical.com/rt/latest/configure.html group and user related options for configure] to fine tune the permissions.&lt;br /&gt;
&lt;br /&gt;
This account will be used throughout the install process to control access to sensitive files. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo groupadd --system rt&lt;br /&gt;
sudo useradd --system --home-dir=/opt/rt5/var --gid=rt rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.3.tar.gz&lt;br /&gt;
tar -xf rt-5.0.3.tar.gz&lt;br /&gt;
cd rt-5.0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-web-user=rt --with-web-group=rt&amp;lt;/code&amp;gt; installs RT using the dedicated accounts we created earlier.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-web-user=rt --with-web-group=rt --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
# WebPath is the path where the RT web server runs on your WebDomain.&lt;br /&gt;
# Edit the path below if you&#039;re using a specific path.&lt;br /&gt;
Set($WebPath, &#039;/&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that will go to the rt-server journal.&lt;br /&gt;
# Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.3&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
Fully documenting how to set up a web server configured for your network with encryption is outside the scope of this guide. This page only highlights the configuration you need to pass web requests onto RT using Apache with mod_fcgid or nginx and the RT FastCGI service.&lt;br /&gt;
&lt;br /&gt;
See the [https://docs.bestpractical.com/rt/latest/web_deployment.html RT deployment guide] for the latest recommendations from Best Practical on how to deploy RT.&lt;br /&gt;
&lt;br /&gt;
=== Apache httpd ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed, are using the [https://docs.bestpractical.com/rt/latest/web_deployment.html#prefork-MPM preform MPM], and the mod_fcgid module is enabled:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&lt;br /&gt;
sudo a2dismod mpm_event&lt;br /&gt;
sudo a2dismod mpm_worker&lt;br /&gt;
sudo systemctl restart apache2&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo systemctl restart apache2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ScriptAlias&amp;lt;/code&amp;gt; lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Optional apache logs for RT&lt;br /&gt;
# Ensure that your log rotation scripts know about these files&lt;br /&gt;
# ErrorLog /opt/rt5/var/log/apache2.error&lt;br /&gt;
# TransferLog /opt/rt5/var/log/apache2.access&lt;br /&gt;
# LogLevel debug&lt;br /&gt;
&lt;br /&gt;
AddDefaultCharset UTF-8&lt;br /&gt;
&lt;br /&gt;
# ScriptAlias and Location should match RT&#039;s WebPath&lt;br /&gt;
&lt;br /&gt;
# If WebPath is empty then use a single slash:&lt;br /&gt;
ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
# If WebPath is &#039;rt&#039; then add that after the slash:&lt;br /&gt;
# ScriptAlias /rt /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&lt;br /&gt;
DocumentRoot &amp;quot;/opt/rt5/share/html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# If WebPath is empty then use a single slash:&lt;br /&gt;
&amp;lt;Location /&amp;gt;&lt;br /&gt;
# If WebPath is &#039;rt&#039; then add that after the slash:&lt;br /&gt;
# &amp;lt;Location /rt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
&amp;lt;/Location&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration location varies by distribution and whether or not you&#039;re using HTTPS:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/apache2/sites-available/default-ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: &amp;lt;code&amp;gt;/etc/apache2/sites-available/000-default.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/httpd/conf.d/ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: Write a new file &amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== nginx ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RT FastCGI service for use with nginx ====&lt;br /&gt;
&lt;br /&gt;
===== Create the RT service =====&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.service&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT service to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
# The --forks option is the number of RT servers to run in parallel.&lt;br /&gt;
# 3 should be good for most initial installs. You can increase this&lt;br /&gt;
# number later if needed for performance.&lt;br /&gt;
ExecStart=/usr/bin/multiwatch --forks=3 --signal=TERM -- /opt/rt5/sbin/rt-server.fcgi&lt;br /&gt;
StandardInput=socket&lt;br /&gt;
User=rt&lt;br /&gt;
UMask=027&lt;br /&gt;
&lt;br /&gt;
CapabilityBoundingSet=&lt;br /&gt;
DevicePolicy=closed&lt;br /&gt;
PrivateMounts=true&lt;br /&gt;
PrivateNetwork=false&lt;br /&gt;
PrivateTmp=true&lt;br /&gt;
PrivateUsers=true&lt;br /&gt;
ProtectControlGroups=true&lt;br /&gt;
ProtectHome=true&lt;br /&gt;
ProtectSystem=full&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
===== Create the RT socket =====&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT socket to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server socket&lt;br /&gt;
Wants=network.target&lt;br /&gt;
After=network.target&lt;br /&gt;
Before=apache2.service httpd.service nginx.service&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
[Socket]&lt;br /&gt;
# ListenStream defines the address and port where the RT FastCGI server listens.&lt;br /&gt;
# This is NOT the web server itself, so don&#039;t make this port 80, 443, etc.&lt;br /&gt;
# You may edit this if you like, but note:&lt;br /&gt;
# Connections are unencrypted. You should only listen on a secure network&lt;br /&gt;
# interface.&lt;br /&gt;
# The server can only accept a single socket. You cannot specify more than&lt;br /&gt;
# one ListenStream address.&lt;br /&gt;
ListenStream=[::1]:5000&lt;br /&gt;
Accept=no&lt;br /&gt;
FreeBind=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
===== Enable the RT socket =====&lt;br /&gt;
&lt;br /&gt;
Start the server socket and enable it on future boots:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl enable --now rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The location path should match the WebPath in your RT site configuration.&lt;br /&gt;
location / {&lt;br /&gt;
  include /etc/nginx/fastcgi.conf;&lt;br /&gt;
  # SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
  # This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
  fastcgi_param SCRIPT_NAME &amp;quot;&amp;quot;;&lt;br /&gt;
  # This network location should match the ListenStream in rt-server.socket.&lt;br /&gt;
  fastcgi_pass localhost:5000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration location varies by distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|Edit &amp;lt;code&amp;gt;/etc/nginx/sites-available/default&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add a new file &amp;lt;code&amp;gt;/etc/nginx/default.d/rt-server.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to Verify the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If the web server returns a 502 Bad Gateway response, it&#039;s having trouble connecting to the RT FCGI server. Check the error logs for your web server:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|nginx&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|Apache on Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|httpd on Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/nginx/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/httpd/error_log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For all kinds of errors, you can check the logs for the RT FCGI server and its socket:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo journalctl --unit rt-server.\*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like msmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, install the [https://metacpan.org/pod/RT::Client::CLI RT::Client::CLI] Perl package on the mail server. For example, you could install cpanminus, then run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cpanm --sudo RT::Client::CLI&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   rt    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
1   *   *   *   *   rt    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
50  3   *   *   *   rt    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon rt    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   rt    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=User_talk:Bkembree&amp;diff=27086</id>
		<title>User talk:Bkembree</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=User_talk:Bkembree&amp;diff=27086"/>
		<updated>2022-05-20T17:15:02Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: Welcome!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Welcome to &#039;&#039;Request Tracker Wiki&#039;&#039;!&#039;&#039;&#039;&lt;br /&gt;
We hope you will contribute much and well.&lt;br /&gt;
You will probably want to read the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents help pages].&lt;br /&gt;
Again, welcome and have fun! [[User:Jbrandt|Jbrandt]] ([[User talk:Jbrandt|talk]]) 13:15, 20 May 2022 (EDT)&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=User:Bkembree&amp;diff=27085</id>
		<title>User:Bkembree</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=User:Bkembree&amp;diff=27085"/>
		<updated>2022-05-20T17:15:02Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: Creating user page for new user.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is my personal bio information.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualEmailConfig&amp;diff=27084</id>
		<title>ManualEmailConfig</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualEmailConfig&amp;diff=27084"/>
		<updated>2022-05-19T17:27:50Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualApacheConfig]] --- Up: [[UserManual]] --- Next: [[ManualBasicAdministration]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= SETTING UP THE MAIL GATEWAY =&lt;br /&gt;
&lt;br /&gt;
The mail gateway is used to receive mail messages &#039;&#039;&#039;into&#039;&#039;&#039; an RT instance; outbound mail is usually just handed off to the local SMTP sending program, or a specified SMTP smarthost.&lt;br /&gt;
&lt;br /&gt;
The mail gateway requires the web UI to be set up and functional. If you intend to use SSL to secure your mail gateway, you need to make sure that lib-www-perl, a.k.a LWP, is built with SSL support.&lt;br /&gt;
&lt;br /&gt;
1) Documentation for setting up the mail gateway can be found at:&lt;br /&gt;
&lt;br /&gt;
https://docs.bestpractical.com/rt/latest/rt-mailgate.html&lt;br /&gt;
&lt;br /&gt;
2) You need to tell your Mail Transfer Agent (e.g. sendmail, postfix, or qmail) how to forward messages to RT&#039;s mail gateway. To do this, create an aliases in your system&#039;s mail aliases file. Here&#039;s an example, which routes mail to the mailbox [=[mailto:rt@example.com rt@example.com]] (and [=[mailto:rt-comment@example.com rt-comment@example.com]]) into new tickets in the RT queue named &#039;&#039;&#039;General&#039;&#039;&#039;. Note that the queue name is case-insensitive.&lt;br /&gt;
&lt;br /&gt;
Add the following lines to /etc/aliases (or your local equivalent such as /etc/mail/aliases):&lt;br /&gt;
     rt: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue general --action correspond --url http://localhost/rt&amp;quot;&lt;br /&gt;
     rt-comment: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue general --action comment --url http://localhost/rt&amp;quot;&lt;br /&gt;
(Replace /opt/rt4 by your RT installation path and http://localhost/rt by the URL of your RT installation on your webserver)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; When you add the above each alias entry should be all one line; make sure you include the quotes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; &amp;lt;code&amp;gt;qmail&amp;lt;/code&amp;gt; users should follow the [[QMail]] link to review caveats about &amp;lt;code&amp;gt;fastforward&amp;lt;/code&amp;gt; command aliases.&lt;br /&gt;
&lt;br /&gt;
Replace &#039;&#039;&#039;general&#039;&#039;&#039; with the name of your queue and &#039;&#039;&#039;rt&#039;&#039;&#039; (before the colon in the alias) with the email address you wish people to send their messages to. You might, for example, have messages to &#039;&#039;&#039;support&#039;&#039;&#039; go into the &#039;&#039;&#039;service&#039;&#039;&#039; queue, and &#039;&#039;&#039;abuse&#039;&#039;&#039; go into the &#039;&#039;&#039;ops&#039;&#039;&#039; queue. You can have more than one set of aliases point to the same queue, if, for example, you wanted mail to both &#039;&#039;&#039;abuse&#039;&#039;&#039; and &#039;&#039;&#039;security&#039;&#039;&#039; both go to the &#039;&#039;&#039;ops&#039;&#039;&#039; queue.&lt;br /&gt;
&lt;br /&gt;
The queue name may have spaces. &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; works as well with them, but do not forget to escape these spaces by enclosing the queue name in single quote:&lt;br /&gt;
    my-queue: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue &#039;My Queue&#039; --action correspond --url http://localhost/&amp;quot;&lt;br /&gt;
If you are using the default sendmail included in most redhat distro&#039;s you will most likely need to copy (cp) rt-mailgate to /etc/smrsh or create a symbolic link and change /opt/rt4/bin above to /etc/smrsh or sendmail will complain. These sendmails will only execute programs as alias targets which have been blessed by placing them in a special directory. This is not necessary for Exim or postfix.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll choose from &amp;quot;--action correspond&amp;quot; and &amp;quot;--action comment&amp;quot; depending on whether the mail should be resent to the requestor. If you want the requestor to see it, choose correspond; if you want to keep it from the requestor, choose comment.&lt;br /&gt;
&lt;br /&gt;
The URL will be the URL for RT&#039;s web interface, such as http://issues.bestpractical.com/, [http://fsck.com/rt/ =]; whatever is the root of your RT install.&lt;br /&gt;
&lt;br /&gt;
3) Stop and start your mail server, so it picks up your configuration changes. With sendmail or postfix (possibly others), you usually also need to type the command &amp;quot;newaliases&amp;quot; to get the server to recognize the new aliases.  If this command is unrecognized, it&#039;s probably not in your default path; a common location is &amp;quot;/usr/sbin/newaliases&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;can&#039;&#039;&#039; have the mail gateway on your MX or some other server and have it talk to RT via HTTP. For more details, see [[InstallMailgateOnly]].&lt;br /&gt;
&lt;br /&gt;
To configure a mail transfer agent (postfix) to post tickets to RT4 on a separate server ....&lt;br /&gt;
&lt;br /&gt;
Add the following lines to /etc/aliases (or your local equivalent such as /etc/mail/aliases):&lt;br /&gt;
    rt: &amp;quot;|/&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate --queue general --action correspond --url http://&amp;amp;lt;the-URL-of-the-RT-server&amp;amp;gt;/&amp;quot;&lt;br /&gt;
    rt-comment: &amp;quot;|/&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate --queue general --action comment --url http://&amp;amp;lt;the-URL-of-the-RT-server&amp;amp;gt;/&amp;quot;&lt;br /&gt;
The link to RT is now configured. However, the rt-mailgate script is a perl script which requires support. On a fresh [[SuSE]] 9.3 server install, the following was needed to provide the necessary perl libraries (someone with deeper knowledge may know of a more restrictive set of libraries, but these worked).&lt;br /&gt;
&lt;br /&gt;
 #(install gcc and glibc, if necessary)&lt;br /&gt;
 perl -MCPAN -eshell (to configure CPAN)&lt;br /&gt;
 perl -MCPAN -e &#039;install(&amp;quot;LWP&amp;quot;)&#039;&lt;br /&gt;
 perl -MCPAN -e &#039;install(&amp;quot;Bundle::LWP&amp;quot;)&#039;&lt;br /&gt;
&lt;br /&gt;
If Using SSL, add:&lt;br /&gt;
    perl -MCPAN -e &#039;install(&amp;quot;Crypt::SSLeay&amp;quot;)&#039;&lt;br /&gt;
To test the connection...&lt;br /&gt;
   echo &#039;hello&#039; | mail -s &amp;quot;Test subject&amp;quot; rt&lt;br /&gt;
If you get a &amp;quot;command died with status 1&amp;quot; error message, the rt-mailgate script possibly doesn&#039;t have the execute bit set for the user/group under which postfix is running.&lt;br /&gt;
   chmod o+x /&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate&lt;br /&gt;
For more information on configuring your mail gateway, see [[ManualAdministration]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Using Fetchmail/Getmail For Incoming Email =&lt;br /&gt;
&lt;br /&gt;
Fetchmail or Getmail can be used to fetch email from a inbox using IMAP or POP. An example configuration for Fetchmail can be seen below:&lt;br /&gt;
&lt;br /&gt;
    set daemon 0&lt;br /&gt;
    # PID files are more useful for forking systemd services. But fetchmail will&lt;br /&gt;
    # always write one. Since the service runs fetchmail as the apache user,&lt;br /&gt;
    # www-data, we need to give fetchmail a path that it has write permission to.&lt;br /&gt;
    #set pidfile &#039;/opt/rt4/var/run/fetchmail-rtir.pid&#039;&lt;br /&gt;
    poll &amp;quot;IP_OF_MAIL_SERVER&amp;quot; proto imap port 993&lt;br /&gt;
        user &amp;quot;rt@mycompany.com&amp;quot; password &amp;quot;password&amp;quot;&lt;br /&gt;
        ssl&lt;br /&gt;
        folder &#039;Inbox&#039;&lt;br /&gt;
    # Some IMAP servers generate an error like this:&lt;br /&gt;
    #&lt;br /&gt;
    # could not decode BASE64 challenge&lt;br /&gt;
    #&lt;br /&gt;
    # This might be because the server is configured to expect&lt;br /&gt;
    # certain authentication attempt types, first. fetchmail also&lt;br /&gt;
    # tries certain authentication methods first, but not password,&lt;br /&gt;
    # even with the &#039;password&#039; keyword.&lt;br /&gt;
    #&lt;br /&gt;
    # The &#039;auth&#039; keyword tells fetchmail to attempt the given&lt;br /&gt;
    # authentication type, first. That can eliminate initial&lt;br /&gt;
    # authentication failures, which might eliminate this error&lt;br /&gt;
    # messgae&lt;br /&gt;
    # IMAP supports flags on individual messages to indicate the&lt;br /&gt;
    # message status. The &#039;Seen&#039; flag indicates that the message has&lt;br /&gt;
    # been read by a client. This could be a webmail client like Gmail&lt;br /&gt;
    # our Outlook, or fetchmail. The RT use case for fetchmail expects&lt;br /&gt;
    # that fetchmail will get all mail that hasn&#039;t been delivered to&lt;br /&gt;
    # RT, regardless of whether other clients have seen it. Without&lt;br /&gt;
    # this option, fetchmail will only download mail from an IMAP&lt;br /&gt;
    # server without the &#039;Seen&#039; flag. This option tells fetchmail to&lt;br /&gt;
    # ignore &#039;Seen&#039; flags and download all messages.&lt;br /&gt;
    # fetchall&lt;br /&gt;
    mda &#039;/opt/rt4/bin/rt-mailgate --url https://rt.mycompany.com --queue &amp;quot;support&amp;quot; --action correspond&#039;&lt;br /&gt;
    idle&lt;br /&gt;
Lastly you will need a cronjob to pull your inbox periodically&lt;br /&gt;
    `*/1 * * * * root /usr/bin/getmail --fetchmailrc /opt/rt4/etc/fetchmailrc --quiet`&lt;br /&gt;
&lt;br /&gt;
If you use MS Office 365 or Google (Gmail) for email, basic authentication (username/password) is no longer allowed. See [[Integrating_RT_Email_with_Google_Mail_(Gmail)]] for details on setting up getmail. [https://metacpan.org/pod/App::wsgetmail App-wsgetmail] is an option for fetching email from MS Office 365.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Prev: [[ManualApacheConfig]] --- Up: [[UserManual]] --- Next: [[ManualBasicAdministration]]&lt;br /&gt;
[[Category:RT User Manual]]&lt;br /&gt;
[[Category:RT44]]&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Integrating_RT_Email_with_Google_Mail_(Gmail)&amp;diff=27083</id>
		<title>Integrating RT Email with Google Mail (Gmail)</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Integrating_RT_Email_with_Google_Mail_(Gmail)&amp;diff=27083"/>
		<updated>2022-05-19T15:42:51Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Retrieving email from a Google Mailbox ==&lt;br /&gt;
&lt;br /&gt;
The utility [https://pyropus.ca/software/getmail/ getmail] version 5.6 and later comes with a script &amp;lt;code&amp;gt;getmail-gmail-xoauth-tokens&amp;lt;/code&amp;gt; which can be used to set up the required OAuth2 configuration to fetch email. The steps for setting up this configuration are described below, starting with configuration in Google.&lt;br /&gt;
&lt;br /&gt;
=== Set up OAuth2 client in Google ===&lt;br /&gt;
&lt;br /&gt;
To run getmail on an RT server, set it up as a &amp;quot;Desktop App&amp;quot;, one of the options noted in the [https://developers.google.com/identity/protocols/oauth2/native-app Google documentation]. Following instructions on that page, keeping the following notes in mind:&lt;br /&gt;
&lt;br /&gt;
* Enable the &amp;quot;Gmail API&amp;quot; as noted in the docs.&lt;br /&gt;
* On the &amp;quot;OAuth consent screen&amp;quot; create, select &amp;quot;Internal&amp;quot; user type, add scope: &amp;quot;Gmail API .../auth/gmail.modify Read, compose, and send emails from your Gmail account&amp;quot;&lt;br /&gt;
* On client id create, set the application type to &amp;quot;Desktop app&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Save the provided &amp;quot;Client ID&amp;quot; and &amp;quot;Client secret&amp;quot; values. These are needed in the next step.&lt;br /&gt;
&lt;br /&gt;
=== Set up getmail on RT server ===&lt;br /&gt;
&lt;br /&gt;
The following are based on [https://www.bytereef.org/howto/oauth2/getmail.html Stefan Krah&#039;s notes], with a few updates.&lt;br /&gt;
&lt;br /&gt;
1. Get the initial OAuth2 token&lt;br /&gt;
&lt;br /&gt;
Create /home/user/.getmail/gmail.json&lt;br /&gt;
&lt;br /&gt;
    {&amp;quot;scope&amp;quot;: &amp;quot;https://mail.google.com/&amp;quot;,&lt;br /&gt;
     &amp;quot;user&amp;quot;: &amp;quot;your_account@gmail.com&amp;quot;,&lt;br /&gt;
     &amp;quot;client_id&amp;quot;: &amp;quot;xzy.apps.googleusercontent.com&amp;quot;,&lt;br /&gt;
     &amp;quot;client_secret&amp;quot;: &amp;quot;foo&amp;quot;,&lt;br /&gt;
     &amp;quot;token_uri&amp;quot;: &amp;quot;https://accounts.google.com/o/oauth2/token&amp;quot;,&lt;br /&gt;
     &amp;quot;auth_uri&amp;quot;: &amp;quot;https://accounts.google.com/o/oauth2/auth&amp;quot;,&lt;br /&gt;
     &amp;quot;redirect_uri&amp;quot;: &amp;quot;http://localhost/&amp;quot;,&lt;br /&gt;
     &amp;quot;auth_provider_x509_cert_url&amp;quot;: &amp;quot;https://www.googleapis.com/oauth2/v1/certs&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
Fill &amp;quot;client_id&amp;quot; and &amp;quot;client_secret&amp;quot; with the real values from the previous step.&lt;br /&gt;
&lt;br /&gt;
Note that redirect_uri &amp;quot;urn:ietf:wg:oauth:2.0:oob&amp;quot; no longer works. You need to give it a URL, which Google will redirect to once you approve the access.&lt;br /&gt;
&lt;br /&gt;
    chmod 600 /home/user/.getmail/gmail.json&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
&lt;br /&gt;
    getmail-gmail-xoauth-tokens --init /home/user/.getmail/gmail.json&lt;br /&gt;
&lt;br /&gt;
This outputs a Google URL and a prompt will wait for a token. Go to that URL and approve it as &amp;quot;your_account@gmail.com&amp;quot;. It will then redirect to a URL like:&lt;br /&gt;
&lt;br /&gt;
    http://localhost/?code=A-VERY-LONG-STRING&amp;amp;scope=https://mail.google.com/&lt;br /&gt;
&lt;br /&gt;
Copy the URL and extract the code value, then paste it in the &amp;lt;code&amp;gt;getmail-gmail-xoauth-tokens&amp;lt;/code&amp;gt; prompt that is waiting. Hit Return and &amp;lt;code&amp;gt;getmail-gmail-xoauth-tokens&amp;lt;/code&amp;gt; should quit silently.&lt;br /&gt;
&lt;br /&gt;
2. Configure getmail to retrieve email&lt;br /&gt;
&lt;br /&gt;
The following is similar to a standard getmail configuration.&lt;br /&gt;
&lt;br /&gt;
Create /home/user/.getmail/getmailrc:&lt;br /&gt;
&lt;br /&gt;
    [retriever]&lt;br /&gt;
    type = SimpleIMAPSSLRetriever&lt;br /&gt;
    server = imap.gmail.com&lt;br /&gt;
    username = your_account@gmail.com&lt;br /&gt;
    use_xoauth2 = True&lt;br /&gt;
    password_command = (&amp;quot;getmail-gmail-xoauth-tokens&amp;quot;, &amp;quot;/home/user/.getmail/gmail.json&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
    [destination]&lt;br /&gt;
    type = MDA_external&lt;br /&gt;
    path = /opt/rt5/bin/rt-mailgate&lt;br /&gt;
    user = root&lt;br /&gt;
    group = root&lt;br /&gt;
    arguments = (&amp;quot;--url&amp;quot;, &amp;quot;http://localhost&amp;quot;, &amp;quot;--queue&amp;quot;, &amp;quot;General&amp;quot;, &amp;quot;--action&amp;quot;, &amp;quot;correspond&amp;quot;,)&lt;br /&gt;
    &lt;br /&gt;
    [options]&lt;br /&gt;
    read_all = false&lt;br /&gt;
&lt;br /&gt;
Test it:&lt;br /&gt;
&lt;br /&gt;
    /usr/bin/getmail --rcfile=/home/user/.getmail/getmailrc&lt;br /&gt;
&lt;br /&gt;
Then edit /etc/cron.d/rt to fetch mail regularly:&lt;br /&gt;
&lt;br /&gt;
    */3 * * * * user /usr/bin/getmail --rcfile=/home/user/.getmail/getmailrc --quiet&lt;br /&gt;
&lt;br /&gt;
== Sending email via Google SMTP ==&lt;br /&gt;
&lt;br /&gt;
For RT, we usually configure postfix to relay to Google via SMTP. For this to work, you need to allow the RT server to send via your Google account. See the [https://support.google.com/a/answer/2956491 Google documentation], along with the following notes:&lt;br /&gt;
&lt;br /&gt;
* In step 6 (Allowed senders section), choose &amp;quot;Only addresses in my domains&amp;quot;&lt;br /&gt;
* In step 7 (Authentication section), choose &amp;quot;Only accept mail from the specified IP addresses&amp;quot;. do not choose &amp;quot;Require SMTP Authentication&amp;quot;&lt;br /&gt;
* In step 8 (Add allowed IP), add public IP address of RT server&lt;br /&gt;
&lt;br /&gt;
Turn on sender envelope in RT site config:&lt;br /&gt;
&lt;br /&gt;
    Set( $SetOutgoingMailFrom, 1 );&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Integrating_RT_Email_with_Google_Mail_(Gmail)&amp;diff=27082</id>
		<title>Integrating RT Email with Google Mail (Gmail)</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Integrating_RT_Email_with_Google_Mail_(Gmail)&amp;diff=27082"/>
		<updated>2022-05-19T14:31:48Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: Jbrandt moved page Set Up RT With Gmail to Integrating RT Email with Google Mail (Gmail) without leaving a redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Incoming emails ==&lt;br /&gt;
&lt;br /&gt;
Assuming &amp;quot;your_account@gmail.com&amp;quot; is RT&#039;s correspond address:&lt;br /&gt;
&lt;br /&gt;
    Set( $CorrespondAddress, &#039;your_account@gmail.com&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Using getmail 5.6+ to fetch emails ===&lt;br /&gt;
&lt;br /&gt;
==== Set up OAuth2 client on google side ====&lt;br /&gt;
&lt;br /&gt;
Based on https://developers.google.com/identity/protocols/oauth2/native-app, here are some notes:&lt;br /&gt;
&lt;br /&gt;
    Enable &amp;quot;Gmail API&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    On &amp;quot;OAuth consent screen&amp;quot; create, select &amp;quot;Internal&amp;quot; user type, add scrop: &amp;quot;Gmail API .../auth/gmail.modify Read, compose, and send emails from your Gmail account&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    On client id create, set the application type to &amp;quot;Desktop app&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Save the &amp;quot;Client ID&amp;quot; and &amp;quot;Client secret&amp;quot; values, which we will need in the next step.&lt;br /&gt;
&lt;br /&gt;
==== Setup getmail on RT server ====&lt;br /&gt;
&lt;br /&gt;
Based on https://www.bytereef.org/howto/oauth2/getmail.html&lt;br /&gt;
&lt;br /&gt;
1. Get initial OAuth2 token&lt;br /&gt;
&lt;br /&gt;
Create /home/user/.getmail/gmail.json&lt;br /&gt;
&lt;br /&gt;
    {&amp;quot;scope&amp;quot;: &amp;quot;https://mail.google.com/&amp;quot;,&lt;br /&gt;
     &amp;quot;user&amp;quot;: &amp;quot;your_account@gmail.com&amp;quot;,&lt;br /&gt;
     &amp;quot;client_id&amp;quot;: &amp;quot;xzy.apps.googleusercontent.com&amp;quot;,&lt;br /&gt;
     &amp;quot;client_secret&amp;quot;: &amp;quot;foo&amp;quot;,&lt;br /&gt;
     &amp;quot;token_uri&amp;quot;: &amp;quot;https://accounts.google.com/o/oauth2/token&amp;quot;,&lt;br /&gt;
     &amp;quot;auth_uri&amp;quot;: &amp;quot;https://accounts.google.com/o/oauth2/auth&amp;quot;,&lt;br /&gt;
     &amp;quot;redirect_uri&amp;quot;: &amp;quot;http://localhost/&amp;quot;,&lt;br /&gt;
     &amp;quot;auth_provider_x509_cert_url&amp;quot;: &amp;quot;https://www.googleapis.com/oauth2/v1/certs&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
Fill &amp;quot;client_id&amp;quot; and &amp;quot;client_secret&amp;quot; with the real values from previous step.&lt;br /&gt;
&lt;br /&gt;
Note that redirect_uri &amp;quot;urn:ietf:wg:oauth:2.0:oob&amp;quot; does &#039;&#039;&#039;not&#039;&#039;&#039; work any more, we need to give it a URL, which google will redirect to once user approves the access.&lt;br /&gt;
&lt;br /&gt;
    chmod 600 /home/user/.getmail/gmail.json&lt;br /&gt;
&lt;br /&gt;
Then run command:&lt;br /&gt;
&lt;br /&gt;
    getmail-gmail-xoauth-tokens --init /home/user/.getmail/gmail.json&lt;br /&gt;
&lt;br /&gt;
It outputs a google URL, go to that URL and approves it as &amp;quot;your_account@gmail.com&amp;quot;, which will redirects to URL like:&lt;br /&gt;
&lt;br /&gt;
    http://localhost/?code=A-VERY-LONG-STRING&amp;amp;scope=https://mail.google.com/&lt;br /&gt;
&lt;br /&gt;
Copy the code value from URL and paste it to the previous getmail-gmail-xoauth-tokens command window, then hit &amp;quot;Return&amp;quot;.&lt;br /&gt;
If everything goes well, getmail-gmail-xoauth-tokens shall quit silently.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Fetch emails&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Create /home/user/.getmail/getmailrc&lt;br /&gt;
&lt;br /&gt;
    [retriever]&lt;br /&gt;
    type = SimpleIMAPSSLRetriever&lt;br /&gt;
    server = imap.gmail.com&lt;br /&gt;
    username = your_account@gmail.com&lt;br /&gt;
    use_xoauth2 = True&lt;br /&gt;
    password_command = (&amp;quot;getmail-gmail-xoauth-tokens&amp;quot;, &amp;quot;/home/user/.getmail/gmail.json&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
    [destination]&lt;br /&gt;
    type = MDA_external&lt;br /&gt;
    path = /opt/rt5/bin/rt-mailgate&lt;br /&gt;
    user = root&lt;br /&gt;
    group = root&lt;br /&gt;
    arguments = (&amp;quot;--url&amp;quot;, &amp;quot;http://localhost&amp;quot;, &amp;quot;--queue&amp;quot;, &amp;quot;General&amp;quot;, &amp;quot;--action&amp;quot;, &amp;quot;correspond&amp;quot;,)&lt;br /&gt;
    &lt;br /&gt;
    [options]&lt;br /&gt;
    read_all = false&lt;br /&gt;
&lt;br /&gt;
Test it:&lt;br /&gt;
&lt;br /&gt;
    /usr/bin/getmail --rcfile=/home/user/.getmail/getmailrc&lt;br /&gt;
&lt;br /&gt;
Then edit /etc/cron.d/rt to fetch mail regularly:&lt;br /&gt;
&lt;br /&gt;
    */3 * * * * user /usr/bin/getmail --rcfile=/home/user/.getmail/getmailrc --quiet&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Outgoing emails ==&lt;br /&gt;
&lt;br /&gt;
=== Route through Google ===&lt;br /&gt;
&lt;br /&gt;
Based on https://support.google.com/a/answer/2956491, here are a few extra notes:&lt;br /&gt;
&lt;br /&gt;
    In step 6(Allowed senders section), choose &amp;quot;Only addresses in my domains&amp;quot;&lt;br /&gt;
    In step 7(Authentication section), choose &amp;quot;Only accept mail from the specified IP addresses&amp;quot;, do &#039;&#039;&#039;not&#039;&#039;&#039; choose &amp;quot;Require SMTP Authentication&amp;quot;&lt;br /&gt;
    In step 8(Add allowed IP), add public IP address of RT server&lt;br /&gt;
&lt;br /&gt;
Turn on sender envelope in RT site config:&lt;br /&gt;
&lt;br /&gt;
    Set( $SetOutgoingMailFrom, 1 );&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Videos&amp;diff=27061</id>
		<title>Videos</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Videos&amp;diff=27061"/>
		<updated>2022-02-04T13:54:40Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: /* Four Part Intro Series from SNAFU */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some great videos are available, some by Best Practical and some by RT users.&lt;br /&gt;
&lt;br /&gt;
== RT ==&lt;br /&gt;
&lt;br /&gt;
=== Four Part Intro Series from SNAFU ===&lt;br /&gt;
&lt;br /&gt;
* [https://youtu.be/ZO_uVLsWXiE Part 1: Basic Intro]&lt;br /&gt;
* [https://youtu.be/YCYL8eGmXlE Part 2: Working on Tickets]&lt;br /&gt;
* [https://youtu.be/G8GRftBTndE Part 3: Bulk Updates and Merging]&lt;br /&gt;
* [https://youtu.be/7ltRWqm-TSI Part 4: Updating Tickets, Navigation, Your Signature]&lt;br /&gt;
* [https://youtu.be/z2gix30KRqo Part 5: Ticket Triage]&lt;br /&gt;
&lt;br /&gt;
=== University of Washington Tips and Tricks ===&lt;br /&gt;
&lt;br /&gt;
* [https://www.youtube.com/watch?v=YD1fSE105Bc University of Washington RT Tips and Tricks]&lt;br /&gt;
&lt;br /&gt;
=== Best Practical Videos ===&lt;br /&gt;
&lt;br /&gt;
* [https://www.youtube.com/watch?v=aBwYK1a8W7U Attachment Handling]&lt;br /&gt;
* [https://www.youtube.com/watch?v=45q3edmNz0s Default Ticket Values]&lt;br /&gt;
* [https://www.youtube.com/watch?v=2_F2G6D6BxQ Asset Management in RT]&lt;br /&gt;
* [https://www.youtube.com/watch?v=gGKWOxb0nIQ Managing SLAs]&lt;br /&gt;
* [https://www.youtube.com/watch?v=sGtKCYLBHHw Automatic Assignment]&lt;br /&gt;
* [https://www.youtube.com/watch?v=yQa44O3EwvM&amp;amp;t=1s Introduction to Request Tracker]&lt;br /&gt;
* [https://www.youtube.com/watch?v=xyBjOURBsOs&amp;amp;t=567s Creating a new queue in RT]&lt;br /&gt;
&lt;br /&gt;
== RTIR ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.youtube.com/watch?v=we8nDQozeCU RTIR Tour]&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27034</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27034"/>
		<updated>2021-11-04T19:12:41Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: /* Set up RT */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install patch tar which gcc gcc-c++ perl-core perl-ExtUtils-MakeMaker graphviz expat-devel gd-devel openssl-devel w3m&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
== Install Perl packaging tools: App::cpanminus and App::Virtualenv ==&lt;br /&gt;
&lt;br /&gt;
App::cpanminus is a tool for installing and managing Perl modules from the popular CPAN repository. It does a lot of the same tasks, and follows a lot of the same UI conventions, as &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;gem&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;npm&amp;lt;/code&amp;gt;, and similar tools. You can install it from your distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install perl-App-cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If your system doesn’t have a cpanminus package available, you can install it from source following the [https://metacpan.org/pod/App::cpanminus#INSTALLATION project instructions].&lt;br /&gt;
&lt;br /&gt;
App::Virtualenv is a tool to create a dedicated space where you install and manage a self-contained set of Perl modules. (If you’re familiar with Python virtual environments, the concept is the same and App::Virtualenv follows a lot of the same usage patterns.) Using it helps avoid situations where changes to distribution packages might potentially break RT. This guide will illustrate creating and using a virtual environment for RT in &amp;lt;code&amp;gt;/opt/rt5venv&amp;lt;/code&amp;gt;, but you can choose another location if you like.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cpanm --sudo App::Virtualenv&lt;br /&gt;
sudo virtualenv.pl --create --empty /opt/rt5venv&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now whenever you want to work on RT (by installing it, upgrading dependencies, installing new extensions, etc.), you need to activate the virtualenv in your shell. This sets various environment variables that your shell uses to work on Perl modules in the right place. You activate the virtualenv by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=/opt/rt5venv/bin/perl&amp;lt;/code&amp;gt; ensures RT uses the virtualenv you set up.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=/opt/rt5venv/bin/perl ./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we make sure the virtualenv is activated in our shell, so dependencies are installed there.&lt;br /&gt;
* &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; is RT’s command to install dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&lt;br /&gt;
make fixdeps install RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file. For a modern install,&lt;br /&gt;
# I recommend logging to syslog, so it goes to journald where it&#039;s easy to&lt;br /&gt;
# query and automatically gets rotated. You set both these paramaters to a&lt;br /&gt;
# standard log level: &#039;debug&#039;, &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;,&lt;br /&gt;
# &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
Set($LogToSTDERR, undef);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &amp;lt;code&amp;gt;--dba=rt_admin&amp;lt;/code&amp;gt; provides the username of the administrator account to use to do the setup. &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; is the name we used earlier to set up a new database server. You can specify a different value if your database has a different adminsitrator account.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init --dba=rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
* &amp;lt;code&amp;gt;--dba=rt_admin&amp;lt;/code&amp;gt; provides the username of the administrator account to use to do the setup. &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; is the name we used earlier to set up a new database server. You can specify a different value if your database has a different adminsitrator account.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask --dba=rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy that output and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # Listen on the standard HTTPS port.&lt;br /&gt;
  # You can change this to a nonstandard port if you must.&lt;br /&gt;
  Listen 443&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem&lt;br /&gt;
    SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=User&amp;diff=27014</id>
		<title>User</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=User&amp;diff=27014"/>
		<updated>2021-09-01T13:09:12Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An RT user is identified by their e-mail address and a username. Each user is also assigned an id by RT, but this id is typically hidden in the RT interface and is not usually used directly.&lt;br /&gt;
&lt;br /&gt;
A user with the &#039;&#039;&#039;Let this user access RT&#039;&#039;&#039; is an active user, meaning they can login (if they have a password) and perform actions in RT. Uncheck this option to disable the user account.&lt;br /&gt;
&lt;br /&gt;
Selecting the checkbox &#039;Let this user be granted rights (Privileged)&#039; on the user administration page makes a user [[Privileged]]. It is also possible to set various configuration options to make new users Privileged when they are created. Privileged users can access the full web interface and can see and modify objects in RT based on their [[Rights]].&lt;br /&gt;
&lt;br /&gt;
If you leave this checkbox unchecked, the user is [[Unprivileged]]. They can still log in if they have a password and they will see the [[SelfService]] interface.&lt;br /&gt;
&lt;br /&gt;
A user can be a member of a [[Group]].&lt;br /&gt;
&lt;br /&gt;
A user with the global user right [[SuperUser]] can do anything.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Privileged&amp;diff=27013</id>
		<title>Privileged</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Privileged&amp;diff=27013"/>
		<updated>2021-09-01T13:05:34Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The group &#039;&#039;&#039;Privileged&#039;&#039;&#039; is one of the three groups for which RT manages the membership automatically. The other two are [[Unprivileged]] and [[Everyone]]. Every user is either a member of the Privileged group or of the Unprivileged group. Membership in the Privileged group means a user will see the normal RT web interface when logging in and not the more limited self service interface.&lt;br /&gt;
&lt;br /&gt;
Selecting the checkbox &#039;Let this user be granted rights (Privileged)&#039; on the user administration page makes a user Privileged. It is also possible to set various configuration options to make new users Privileged when they are created.&lt;br /&gt;
&lt;br /&gt;
Put simply:&lt;br /&gt;
&lt;br /&gt;
* Unprivileged -&amp;gt; User sees [[SelfService]] interface when logging in&lt;br /&gt;
* Privileged -&amp;gt; User see the regular RT interface (RT at a glance homepage, etc.)&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=SelfService&amp;diff=27012</id>
		<title>SelfService</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=SelfService&amp;diff=27012"/>
		<updated>2021-09-01T13:00:12Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[SelfService]] interface is available for [[Unprivileged]] users who have been given a password to login. You can configure RT to automatically generate a password for users by following the directions in the [[AutogeneratedPassword]] node.&lt;br /&gt;
&lt;br /&gt;
The [[SelfService]] interface only lists tickets for which the logged in user is a [[Requestor]]. If you wish for users to also see tickets for which they are [[CC]] or [[AdminCC]], see [[OnCreateSetDeptHeadCc]].&lt;br /&gt;
&lt;br /&gt;
Example: A department manager may be made Cc on all tickets created by her staff so that she can see what issues are currently active in her department.&lt;br /&gt;
&lt;br /&gt;
The [[SelfService]] interface is accessible by appending &amp;quot;SelfService&amp;quot; the end of your RT Web site URL. For example, if your RT web interface is setup at http://support.mycompany.com, the SelfService interface would be at http://support.mycompany.com/SelfService/.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Unprivileged&amp;diff=27011</id>
		<title>Unprivileged</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Unprivileged&amp;diff=27011"/>
		<updated>2021-09-01T12:56:25Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The group &#039;&#039;&#039;Unprivileged&#039;&#039;&#039; is one of the three groups for which RT manages the membership automatically. The other two are [[Privileged]] and [[Everyone]]. Every user is either a member of the Privileged group or of the Unprivileged group.&lt;br /&gt;
&lt;br /&gt;
Unchecking the checkbox &#039;Let this user be granted rights (Privileged)&#039; checkbox on the user administration page makes a user Unprivileged. In a default RT configuration, new users are created Unprivileged, as when an email comes in and a new user account is automatically created.&lt;br /&gt;
&lt;br /&gt;
Unprivileged users get access to the [[SelfService]] interface, which is limited to pages under &#039;&#039;/SelfService/&#039;&#039;.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Privileged&amp;diff=27010</id>
		<title>Privileged</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Privileged&amp;diff=27010"/>
		<updated>2021-09-01T12:48:08Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The group &#039;&#039;&#039;Privileged&#039;&#039;&#039; is one of the three groups for which RT manages the membership automatically. The other two are [[Unprivileged]] and [[Everyone]]. Every user is either a member of the Privileged group or of the Unprivileged group. Membership in the Privileged group means a user will see the normal RT web interface when logging in and not the more limited self service interface.&lt;br /&gt;
&lt;br /&gt;
Selecting the checkbox &#039;Let this user be granted rights (Privileged)&#039; checkbox on the user administration page makes a user Privileged. It is also possible to set various configuration options to make new users Privileged when they are created.&lt;br /&gt;
&lt;br /&gt;
Put simply:&lt;br /&gt;
&lt;br /&gt;
* Unprivileged -&amp;gt; User sees [[SelfService]] interface when logging in&lt;br /&gt;
* Privileged -&amp;gt; User see the regular RT interface (RT at a glance homepage, etc.)&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualRights&amp;diff=26998</id>
		<title>ManualRights</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualRights&amp;diff=26998"/>
		<updated>2021-02-18T18:29:47Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualAdministration]] --- Up: [[UserManual]] --- Next: [[ManualScrips]]&lt;br /&gt;
&lt;br /&gt;
[[File:Global-Group-Rights.png|Global group rights|thumb|500px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Appendix 2 Rights&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a reference for rights in RT.&lt;br /&gt;
&lt;br /&gt;
There are a great deal of places in RT where you can assign rights to a group or a user. While this is a feature of RT, we recommend adding users to a group, then applying rights directly on that group. When rights are granted on specific users, it can become more challenging to manage each user&#039;s rights.&lt;br /&gt;
&lt;br /&gt;
Below is a list of all the areas in RT to update group and user rights. From the Admin menu:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Custom Fields&lt;br /&gt;
:* Custom Fields &amp;gt; Select &amp;gt; [select custom field] &amp;gt; Group Rights&lt;br /&gt;
:* Custom Fields &amp;gt; Select &amp;gt; [select custom field] &amp;gt; User Rights&lt;br /&gt;
:* Global &amp;gt; Custom Fields &amp;gt; [select Users, Groups, Queues, Tickets, Articles, Assets] &amp;gt; [select custom field] &amp;gt; Group Rights&lt;br /&gt;
:* Global &amp;gt; Custom Fields &amp;gt; [select Users, Groups, Queues, Tickets, Articles, Assets] &amp;gt; [select custom field] &amp;gt; User Rights&lt;br /&gt;
&lt;br /&gt;
[[File:Queue-Group-Rights.png|Queue level rights by group|thumb|500px]]&lt;br /&gt;
&lt;br /&gt;
* Groups&lt;br /&gt;
:* Groups &amp;gt; Select &amp;gt; [select group] &amp;gt; Group Rights&lt;br /&gt;
:* Groups &amp;gt; Select &amp;gt; [select group] &amp;gt; User Rights&lt;br /&gt;
:* Global &amp;gt; Group Rights&lt;br /&gt;
&lt;br /&gt;
* Queues&lt;br /&gt;
:* Queue &amp;gt; Select &amp;gt; [select queue] &amp;gt; Group Rights&lt;br /&gt;
:* Queue &amp;gt; Select &amp;gt; [select queue] &amp;gt; User Rights&lt;br /&gt;
&lt;br /&gt;
* Users (not suggested)&lt;br /&gt;
:* Global &amp;gt; User Rights&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See also [[Rights]] article.&lt;br /&gt;
&lt;br /&gt;
If you have an RT with existing rights set up and you are trying to find which of the above was used to grant them, you can use the Rights Inspector. This tool is available as an [https://metacpan.org/pod/RT::Extension::RightsInspector extension] for RT 4.4 and it is a core feature starting in RT 5.0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Prev: [[ManualAdministration]] --- Up: [[UserManual]] --- Next: [[ManualScrips]]&lt;br /&gt;
[[Category:RT User Manual]]&lt;br /&gt;
[[Category:RT44]]&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=User_talk:Ajtast&amp;diff=26950</id>
		<title>User talk:Ajtast</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=User_talk:Ajtast&amp;diff=26950"/>
		<updated>2019-12-13T14:04:39Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: Welcome!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Welcome to &#039;&#039;Request Tracker Wiki&#039;&#039;!&#039;&#039;&#039;&lt;br /&gt;
We hope you will contribute much and well.&lt;br /&gt;
You will probably want to read the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents help pages].&lt;br /&gt;
Again, welcome and have fun!&lt;br /&gt;
 [[User:Jbrandt|Jbrandt]] ([[User talk:Jbrandt|talk]])&lt;br /&gt;
 09:04, 13 December 2019 (EST)&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=User:Ajtast&amp;diff=26949</id>
		<title>User:Ajtast</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=User:Ajtast&amp;diff=26949"/>
		<updated>2019-12-13T14:04:39Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: Creating user page for new user.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Perl coder in deepest darkest cornwall&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=REST&amp;diff=26912</id>
		<title>REST</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=REST&amp;diff=26912"/>
		<updated>2019-05-02T17:10:00Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
&lt;br /&gt;
The REST Interface gives you access to your RT Database. The complete communication is encapsulated in the HTTP protocol. The interface should be accessible in your installation.&lt;br /&gt;
&lt;br /&gt;
Though you may see references to older 3.x releases of RT below, the REST 1.0 interface has not changed in any significant way in 4.x.&lt;br /&gt;
&lt;br /&gt;
This page is for REST version 1.0. The next version of the RT REST interface, version 2.0, is available as an [https://metacpan.org/pod/RT::Extension::REST2 extension].&lt;br /&gt;
&lt;br /&gt;
[{{SERVER}}/index.php?search={{TALKPAGENAME}}&amp;amp;title=Special:Search Legacy Comments] are available from the previous Wikia instance.&lt;br /&gt;
&lt;br /&gt;
== Interface ==&lt;br /&gt;
&lt;br /&gt;
Base URL: &amp;lt;code&amp;gt;.../REST/1.0/&amp;lt;/code&amp;gt;. The default response should be:&lt;br /&gt;
&lt;br /&gt;
    RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
    # Invalid object specification: &#039;index.html&#039;&lt;br /&gt;
&lt;br /&gt;
    id: index.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
The REST Interface does not support HTTP-Authentication. So you must get a valid Session-Token and submit the cookie each request. You usually get a Session-Cookie by submitting the default login form. Use variables &amp;quot;&amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt;&amp;quot; for login and &amp;quot;&amp;lt;code&amp;gt;pass&amp;lt;/code&amp;gt;&amp;quot; for password values. wget doesn&#039;t escape any characters in the --post-data option so make sure you properly escape any special characters in the password.&lt;br /&gt;
&lt;br /&gt;
See the wget invocation line below:&lt;br /&gt;
&lt;br /&gt;
    wget  --keep-session-cookies \&lt;br /&gt;
    --save-cookies cookies.txt \&lt;br /&gt;
    --post-data &#039;user=UUUU&amp;amp;pass=PPPP&#039; \&lt;br /&gt;
    http://my.rt.server&lt;br /&gt;
&lt;br /&gt;
You need the -keep-session-cookies option to make wget save session cookies.&lt;br /&gt;
&lt;br /&gt;
=== Ticket ===&lt;br /&gt;
&lt;br /&gt;
==== Ticket Properties ====&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single ticket, not including the history and comments.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.4.5 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;&lt;br /&gt;
 Queue: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Owner: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Creator: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Subject: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Status: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Priority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 InitialPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 FinalPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Requestors: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Cc: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 AdminCc: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Created: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Starts: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Started: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Due: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Resolved: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Told: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeEstimated: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeWorked: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeLeft: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Links ====&lt;br /&gt;
&lt;br /&gt;
Gets the ticket links for a single ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links/show&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.2 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&lt;br /&gt;
 HasMember: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 ReferredToBy: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 DependedOnBy: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 MemberOf: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 RefersTo: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 DependsOn: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachments ====&lt;br /&gt;
&lt;br /&gt;
Gets a list of all attachments related to the ticket&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachment ====&lt;br /&gt;
Gets the metadata and content of a specific attachment.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments/&amp;amp;lt;attachment-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.8.0 200 Ok&lt;br /&gt;
 &lt;br /&gt;
id: &amp;lt;attachment-id&amp;gt;&lt;br /&gt;
Subject:&lt;br /&gt;
Creator: &amp;lt;user-id&amp;gt;&lt;br /&gt;
Created: &amp;lt;timestamp&amp;gt;&lt;br /&gt;
Transaction: &amp;lt;transaction-id&amp;gt;&lt;br /&gt;
Parent: &amp;lt;parent-id&amp;gt;&lt;br /&gt;
MessageId:&lt;br /&gt;
Filename: &amp;lt;filename&amp;gt;&lt;br /&gt;
ContentType: application/octet-stream&lt;br /&gt;
ContentEncoding: none&lt;br /&gt;
 &lt;br /&gt;
Headers: MIME-Version: 1.0&lt;br /&gt;
         X-Mailer: MIME-tools 5.427 (Entity 5.427)&lt;br /&gt;
         Content-Type: application/octet-stream;&lt;br /&gt;
           name=&amp;quot;&amp;lt;filename&amp;gt;&amp;quot;&lt;br /&gt;
         Content-Disposition: inline; filename=&amp;quot;&amp;lt;filename&amp;gt;&amp;quot;&lt;br /&gt;
         Content-Transfer-Encoding: base64&lt;br /&gt;
         Content-Length: &amp;lt;length in bytes&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Content: ...&lt;br /&gt;
         ...&lt;br /&gt;
         ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE: RT returns the content indented with 9 spaces on each line, so that it lines up with the &amp;quot;Content:&amp;quot; header. Even if you strip this out with a regexp, the content is still UTF-8, which is probably not what you want. To get the original binary data back, strip out the 9 spaces with a regexp, strip off the 3 carriage returns at the end, and then convert the whole thing from UTF-8 to the native character encoding of the attachment, whatever that is. RT doesn&#039;t tell you, so you have know. If the attachments were uploaded by a U.S. Windows system, odds are that Windows-1252 is what you want. If you can&#039;t get the binary back intact, see the next method below.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachment Content ====&lt;br /&gt;
&lt;br /&gt;
Gets the attachment data content without additional metadata or whitespace characters&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments/&amp;amp;lt;attachment-id&amp;amp;gt;/content&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.0 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
So to get the original content you still have to strip the first 2 lines of the response.&lt;br /&gt;
&lt;br /&gt;
==== Ticket History ====&lt;br /&gt;
Gets a list of all the history items for a given ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;history-count&amp;gt;/&amp;lt;history-count&amp;gt; (/total)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;history-id&amp;gt;: &amp;lt;history-name&amp;gt;&lt;br /&gt;
&amp;lt;history-id&amp;gt;: &amp;lt;history-name&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get an additional row, for each history entry found. The first entry is usually: &amp;quot;&amp;lt;code&amp;gt;Ticket created by ...&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
There are two ways to get history item detail: you can do one of these and then recursively perform &amp;lt;code&amp;gt;ticket/history/id/&amp;amp;lt;history-id&amp;amp;gt;&amp;lt;/code&amp;gt; for each history-id from this REST call, but that is extremely wasteful and will scale horribly. What you really want to do is one REST call but get the long format:&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history?format=l&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.8.2 200 Ok&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;n&amp;gt;/&amp;lt;n&amp;gt; (id/&amp;amp;lt;history-id&amp;amp;gt;/total)&lt;br /&gt;
&lt;br /&gt;
id: &amp;lt;history-id&amp;gt;&lt;br /&gt;
Ticket: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
TimeTaken: &amp;lt;...&amp;gt;&lt;br /&gt;
Type: &amp;lt;...&amp;gt;&lt;br /&gt;
Field: &amp;lt;...&amp;gt;&lt;br /&gt;
OldValue: &amp;lt;...&amp;gt;&lt;br /&gt;
NewValue: &amp;lt;...&amp;gt;&lt;br /&gt;
Data: &amp;lt;...&amp;gt;&lt;br /&gt;
Description: &amp;lt;...&amp;gt;&lt;br /&gt;
Content: &amp;lt;...&amp;gt;&lt;br /&gt;
Creator: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Created: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attachments:&lt;br /&gt;
             &amp;lt;attachment-id&amp;gt;: &amp;lt;filename&amp;gt; (&amp;lt;size&amp;gt;)&lt;br /&gt;
             &amp;lt;attachment-id&amp;gt;: &amp;lt;filename&amp;gt; (&amp;lt;size&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;n&amp;gt;/&amp;lt;n&amp;gt; (id/&amp;amp;lt;history-id&amp;amp;gt;/total)&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE: the double dash &amp;quot;--&amp;quot; will occur in the long format between each history item. You can split the output on &amp;quot;--&amp;quot; and iterate over it, parsing out the data with an RFC822 parser, such as an email handling library.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Ticket History Entry ====&lt;br /&gt;
Gets the history information for a single history item. Note that the history item must actually correspond to the ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history/id/&amp;amp;lt;history-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
# 70/70 (id/114856/total)&lt;br /&gt;
&lt;br /&gt;
id: &amp;lt;history-id&amp;gt;&lt;br /&gt;
Ticket: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
TimeTaken: &amp;lt;...&amp;gt;&lt;br /&gt;
Type: &amp;lt;...&amp;gt;&lt;br /&gt;
Field: &amp;lt;...&amp;gt;&lt;br /&gt;
OldValue: &amp;lt;...&amp;gt;&lt;br /&gt;
NewValue: &amp;lt;...&amp;gt;&lt;br /&gt;
Data: &amp;lt;...&amp;gt;&lt;br /&gt;
Description: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Content: &amp;lt;lin1-0&amp;gt;&lt;br /&gt;
         &amp;lt;line-1&amp;gt;&lt;br /&gt;
         ...&lt;br /&gt;
         &amp;lt;line-n&amp;gt;&lt;br /&gt;
         &lt;br /&gt;
Creator: &amp;lt;...&amp;gt;&lt;br /&gt;
Created: &amp;lt;...&amp;gt;&lt;br /&gt;
Attachments: &amp;lt;...&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IMPORTANT NOTE: At least with RT 3.8.0, when you request a history item with this method AND you have attached a file that has Mime type text/plain to the same item (eg. a comment with an attachement), RT will return the complete content of the attachment for the key &amp;quot;Content:&amp;quot; and not your real comment that you can see in the web frontend. This may lead to some problems if the requestor does not expect to get a comment content that is for example 1.8 MB of text. With other Mime type attachments this however seems to work. I don&#039;t know if this is a feature or a bug.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &#039;&#039;&#039;Ticket Search&#039;&#039;&#039; ====&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=&amp;amp;lt;query&amp;amp;gt;&amp;amp;orderby=&amp;amp;lt;sort-order&amp;amp;gt;&amp;amp;format=&amp;amp;lt;format&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;query&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use any query generated by the query builder - or feel free to write your own. Here an example that will do the following: Find all tickets that have no owner and the status new or open&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;query= Owner = &#039;Nobody&#039; AND ( Status = &#039;new&#039; OR Status = &#039;open&#039; )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: to get all the tickets in &amp;quot;fooQueue&amp;quot; you&#039;d access:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: to get the tickets for a custom field &amp;quot;Contact Name&amp;quot; you&#039;d access:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=&#039;CF.{Contact Name}&#039;=&#039;Shaun Wallace&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;orderby&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By this parameter you can change the sort field and order of the search result. To sort a list ascending just put a + before the fieldname, otherwise a -. Eg: -Created (will put the newest tickets at the beginning).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;amp;orderby=+Created&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;format&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* i: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;&lt;br /&gt;
* s: &amp;amp;lt;ticket-id&amp;amp;gt;: &amp;amp;lt;ticket-subject&amp;amp;gt;&lt;br /&gt;
* l: a multi-line format&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;amp;orderby=+Created&amp;amp;format=i&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fields&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A list of fields you would like included in the result set.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=id=42&amp;amp;format=l&amp;amp;fields=Subject,Status,Priority,CF.\{Category\}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that you may need to escape characters like the curly braces for CFs.&lt;br /&gt;
&lt;br /&gt;
==== &#039;&#039;&#039;Ticket Create&#039;&#039;&#039; ====&lt;br /&gt;
&lt;br /&gt;
To create a new ticket: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/new&amp;lt;/code&amp;gt; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line, example:&lt;br /&gt;
&lt;br /&gt;
Testing the new ticket section&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: ticket/new&lt;br /&gt;
Queue: &amp;lt;queue name&amp;gt;&lt;br /&gt;
Requestor: &amp;lt;requestor email address&amp;gt;&lt;br /&gt;
Subject: &amp;lt;subject&amp;gt;&lt;br /&gt;
Cc: &amp;lt;...&amp;gt;&lt;br /&gt;
AdminCc: &amp;lt;...&amp;gt;&lt;br /&gt;
Owner: &amp;lt;...&amp;gt;&lt;br /&gt;
Status: &amp;lt;...&amp;gt;&lt;br /&gt;
Priority: &amp;lt;...&amp;gt;&lt;br /&gt;
InitialPriority: &amp;lt;...&amp;gt;&lt;br /&gt;
FinalPriority: &amp;lt;...&amp;gt;&lt;br /&gt;
TimeEstimated: &amp;lt;...&amp;gt;&lt;br /&gt;
Starts: &amp;lt;...&amp;gt;&lt;br /&gt;
Due: &amp;lt;...&amp;gt;&lt;br /&gt;
Text: &amp;lt;The ticket content&amp;gt;&lt;br /&gt;
CF-&amp;lt;CustomFieldName&amp;gt;: &amp;lt;CustomFieldValue&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are any &amp;quot;special&amp;quot; characters (Umlauts, dash, ...?) in a custom field&#039;s name, you can still access it via its ID:&lt;br /&gt;
 CF-$id: &amp;lt;Value&amp;gt;&lt;br /&gt;
If you want to have a multiline Text, prefix every line with a blank.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Due: &amp;lt;...&amp;gt;&lt;br /&gt;
Text: This is &lt;br /&gt;
 a &lt;br /&gt;
 multiline Text&lt;br /&gt;
 !!!&lt;br /&gt;
CF-&amp;lt;CustomFieldName&amp;gt;: &amp;lt;CustomFieldValue&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response should look like: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/4.0.6 200 Ok&lt;br /&gt;
&lt;br /&gt;
# Ticket 775 created.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== curl example =====&lt;br /&gt;
    &lt;br /&gt;
  * Create a file containing the ticket form:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: ticket/new&lt;br /&gt;
Queue: queue1&lt;br /&gt;
Requestor: requestor@email&lt;br /&gt;
Priority: 4&lt;br /&gt;
CF-Type of request: Demande&lt;br /&gt;
Subject: Test REST&lt;br /&gt;
Text: Multi line&lt;br /&gt;
 test with&lt;br /&gt;
 special chars: é&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  * Submit using curl:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
curl --data-urlencode content@file.name &#039;https://HOSTNAME/REST/1.0/ticket/new?user=USER&amp;amp;pass=PASSWORD&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Ticket Edit ====&lt;br /&gt;
To update an existing ticket: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/edit&amp;lt;/code&amp;gt; with a variable named &amp;quot;content&amp;quot;, containing &amp;quot;key: value&amp;quot; line by line (like the one displayed when issuing &amp;lt;code&amp;gt;ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;). Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Priority: 5&lt;br /&gt;
TimeWorked: 15&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*PHP&lt;br /&gt;
   &amp;lt;pre&amp;gt; &lt;br /&gt;
                    $username = rt_user;&lt;br /&gt;
                    $password = rt_pass;&lt;br /&gt;
                    $url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/&amp;lt;ticket id&amp;gt;/edit?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
                    $request = new HttpRequest($url, HTTP_METH_POST);&lt;br /&gt;
                    $post_data=array(&amp;quot;content&amp;quot;=&amp;gt;&amp;quot;AdminCc: userX\nText: This is a REST test edit ticket\n&amp;quot;);&lt;br /&gt;
                    &lt;br /&gt;
                    // add the post fields  &lt;br /&gt;
                    $request-&amp;gt;addPostFields($postData);&lt;br /&gt;
                    // response from RT&lt;br /&gt;
                    $response = $request-&amp;gt;send()-&amp;gt;getBody();&lt;br /&gt;
                    print_r($response);&lt;br /&gt;
                    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tickets History Reply ====&lt;br /&gt;
Same as comment: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/comment&amp;lt;/code&amp;gt; with a variable name &amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
Action: correspond&lt;br /&gt;
Text: the text comment&lt;br /&gt;
Cc: &amp;lt;...&amp;gt;&lt;br /&gt;
Bcc: &amp;lt;...&amp;gt;&lt;br /&gt;
TimeWorked: &amp;lt;...&amp;gt;&lt;br /&gt;
Attachment: an attachment filename/path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Cc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Bcc&amp;lt;/code&amp;gt; are for this reply only (&#039;&#039;I think&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
==== Ticket History Comment ====&lt;br /&gt;
To add a comment to an existing ticket: POST on &amp;quot;&amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/comment&amp;lt;/code&amp;gt;&amp;quot; with a variable name &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
Action: comment&lt;br /&gt;
Text: the text comment&lt;br /&gt;
Attachment: an attachment filename/path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Action can be &amp;quot;&amp;lt;code&amp;gt;comment&amp;lt;/code&amp;gt;&amp;quot; or &amp;quot;&amp;lt;code&amp;gt;correspond&amp;lt;/code&amp;gt;&amp;quot;. For a list of fields you can use in correspondence, try &amp;quot;&amp;lt;code&amp;gt;/opt/rt3/bin/rt correspond ticket/1&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your comment contains multiple lines, each new line must be preceded by a space (e.g. &amp;quot;line 1\n line 2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you want to use HTML replies, use &amp;lt;pre&amp;gt;Content-Type: text/html&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you used &amp;quot;&amp;lt;code&amp;gt;Attachment&amp;lt;/code&amp;gt;&amp;quot;, you must add to your POST a variable &amp;quot;&amp;lt;code&amp;gt;attachment_1&amp;lt;/code&amp;gt;&amp;quot; that contains the raw attachment in multi-part file object.&lt;br /&gt;
&lt;br /&gt;
You can upload more attachments as well, in this case you have to separate the file names in the &amp;quot;&amp;lt;code style=&amp;quot;border-style: initial; border-color: initial; &amp;quot;&amp;gt;Attachment&amp;lt;/code&amp;gt;&amp;quot; with &amp;quot;\n &amp;quot;(a newline and space, without quotes) and add a new variable &amp;quot;attachment_$i&amp;quot; to your POST where $i is the index of attachment.&lt;br /&gt;
&lt;br /&gt;
You need to send header to post comments&lt;br /&gt;
&lt;br /&gt;
==== Ticket Links Edit ====&lt;br /&gt;
To update links on an existing ticket: POST on &amp;quot;&amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&amp;lt;/code&amp;gt;&amp;quot; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line (like the one displayed when issuing &amp;quot;&amp;lt;code&amp;gt;ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&amp;lt;/code&amp;gt;&amp;quot;). Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DependsOn: 54354&lt;br /&gt;
RefersTo: http://some.external/link&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Merge ====&lt;br /&gt;
To merge tickets: POST on &amp;quot;&amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;origin-ticket-id&amp;amp;gt;/merge/&amp;amp;lt;into-ticket-id&amp;amp;gt;&amp;lt;/code&amp;gt;&amp;quot;. (I don&#039;t think any content is required, but I send &amp;quot;id&amp;quot; and &amp;quot;into&amp;quot; anyway.)&lt;br /&gt;
&lt;br /&gt;
=== User Properties ===&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single user.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/user/&amp;amp;lt;user-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.4 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: user/&amp;amp;lt;user-id&amp;amp;gt;&lt;br /&gt;
 Name: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Password: ********&lt;br /&gt;
 EmailAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 RealName: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Organization: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Privileged: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Disabled: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also you can use user login instead of user ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ===&lt;br /&gt;
&lt;br /&gt;
==== User Create ====&lt;br /&gt;
&lt;br /&gt;
To create a new user: post on &amp;lt;code&amp;gt;/REST/1.0/user/new&amp;lt;/code&amp;gt; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line, like the response to &amp;lt;code&amp;gt;/user/&amp;amp;lt;ticket-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== User Edit ====&lt;br /&gt;
To update an existing user: post on &amp;lt;code&amp;gt;/REST/1.0/user/&amp;amp;lt;user-id&amp;amp;gt;/edit&amp;lt;/code&amp;gt; with a variable named &amp;quot;content&amp;quot;, containing &amp;quot;key: value&amp;quot; line by line (like the one displayed when issuing &amp;lt;code&amp;gt;user/&amp;amp;lt;user-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Queue Properties ===&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single queue.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/queue/&amp;amp;lt;queue-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.4 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: queue/&amp;amp;lt;queue-id&amp;amp;gt;&lt;br /&gt;
 Name: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Description: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 CorrespondAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 CommentAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 InitialPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 FinalPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 DefaultDueIn: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Logout ===&lt;br /&gt;
&lt;br /&gt;
To logout: post on &amp;lt;code&amp;gt;/REST/1.0/logout&amp;lt;/code&amp;gt; with empty content.&lt;br /&gt;
&lt;br /&gt;
== Types ==&lt;br /&gt;
&lt;br /&gt;
*new&lt;br /&gt;
*open&lt;br /&gt;
*stalled&lt;br /&gt;
*resolved&lt;br /&gt;
*rejected&lt;br /&gt;
*deleted&lt;br /&gt;
+ other custom values defined in you local RT portal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== History entry type ===&lt;br /&gt;
* Create&lt;br /&gt;
* CustomField&lt;br /&gt;
* EmailRecord&lt;br /&gt;
* Status&lt;br /&gt;
* CommentEmailRecord&lt;br /&gt;
* Correspond&lt;br /&gt;
* Comment&lt;br /&gt;
* Priority&lt;br /&gt;
* Give&lt;br /&gt;
* Steal&lt;br /&gt;
* Take&lt;br /&gt;
* Untake&lt;br /&gt;
* AddWatcher&lt;br /&gt;
* DeleteWatcher&lt;br /&gt;
* AddLink&lt;br /&gt;
* DeleteLink&lt;br /&gt;
* AddReminder&lt;br /&gt;
* OpenReminder&lt;br /&gt;
* ResolveReminder&lt;br /&gt;
* Set&lt;br /&gt;
* Force&lt;br /&gt;
* Subject&lt;br /&gt;
* Told&lt;br /&gt;
* PurgeTransaction&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
=== Data format ===&lt;br /&gt;
&lt;br /&gt;
* History entries time returns in UTC, boolean returns as &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; (true) and &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;(false). &lt;br /&gt;
&lt;br /&gt;
* Use only &amp;lt;code&amp;gt;&amp;quot;\n&amp;quot;&amp;lt;/code&amp;gt;, not &amp;lt;code&amp;gt;&amp;quot;\r\n&amp;quot;&amp;lt;/code&amp;gt;in post content. &lt;br /&gt;
&lt;br /&gt;
* Comments in response body starts with with a hash (&amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;) symbol.&lt;br /&gt;
&lt;br /&gt;
=== Request status ===&lt;br /&gt;
To get real request/post status you need to check status code in first line of server response.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Perl ===&lt;br /&gt;
To get the results of a single request (without setting the Session-Cookie) - assuming you&#039;ve set:&lt;br /&gt;
&lt;br /&gt;
* $uri to your RT REST URL&lt;br /&gt;
* $access_user to your username&lt;br /&gt;
* $access_password to your password&lt;br /&gt;
* $ticketNumber to the ticket you want to see&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
my $ua = LWP::UserAgent-&amp;amp;gt;new;&lt;br /&gt;
$ua-&amp;gt;timeout(10);&lt;br /&gt;
$ua-&amp;gt;agent(&amp;quot;YOURUSERAGENTHERE&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
my $response = $ua-&amp;gt;post($uri.&amp;quot;ticket/$ticketNumber&amp;quot;,&lt;br /&gt;
   [&#039;user&#039; =&amp;gt; $access_user, &#039;pass&#039; =&amp;gt; $access_password],&lt;br /&gt;
    &#039;Content_Type&#039; =&amp;gt; &#039;form-data&#039;);&lt;br /&gt;
&lt;br /&gt;
if ($response-&amp;amp;gt;is_success) {&lt;br /&gt;
   print $response-&amp;gt;decoded_content;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import org.apache.commons.httpclient.HttpClient;&lt;br /&gt;
import org.apache.commons.httpclient.methods.PostMethod;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.Part;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.StringPart;&lt;br /&gt;
  &lt;br /&gt;
public class RtTicketCreator {&lt;br /&gt;
   static final String BASE_URI = &amp;quot;http://rt.xxx.com/REST/1.0&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
   public static void main(String[] args) throws IOException {&lt;br /&gt;
 &lt;br /&gt;
      PostMethod mPost = new PostMethod(BASE_URI + &amp;quot;/ticket/new?user=username&amp;amp;amp;pass=password&amp;quot;);&lt;br /&gt;
      Part[] parts = { new StringPart(&amp;quot;content&amp;quot;, &amp;quot;Queue: General\nSubject: 123&amp;quot;) };&lt;br /&gt;
      mPost.setRequestEntity(new MultipartRequestEntity(parts, mPost.getParams()));&lt;br /&gt;
      HttpClient cl = new HttpClient();&lt;br /&gt;
      cl.executeMethod(mPost);&lt;br /&gt;
      System.out.println(mPost.getResponseBodyAsString());&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Java ( Based on new Apache HttpComponents library ) ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
* RT ticket creator based on the current Apache HttpComponents library 4.1.3&lt;br /&gt;
* Created by Koustubha Kale, kmkale at youtility dot in&lt;br /&gt;
*/&lt;br /&gt;
import org.apache.http.HttpEntity;&lt;br /&gt;
import org.apache.http.HttpResponse;&lt;br /&gt;
import org.apache.http.auth.AuthScope;&lt;br /&gt;
import org.apache.http.auth.UsernamePasswordCredentials;&lt;br /&gt;
import org.apache.http.client.HttpClient;&lt;br /&gt;
import org.apache.http.client.methods.HttpPost;&lt;br /&gt;
import org.apache.http.entity.mime.MultipartEntity;&lt;br /&gt;
import org.apache.http.entity.mime.content.StringBody;&lt;br /&gt;
import org.apache.http.impl.client.DefaultHttpClient;&lt;br /&gt;
import org.apache.http.util.EntityUtils;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class NewApacheHttpcomponentsRtTicketCreator {&lt;br /&gt;
&lt;br /&gt;
    public static void main(String[] args) throws Exception {&lt;br /&gt;
        &lt;br /&gt;
        DefaultHttpClient httpclient = new DefaultHttpClient();&lt;br /&gt;
	try {&lt;br /&gt;
            &lt;br /&gt;
            HttpPost httppost = new HttpPost(&amp;quot;http://rt.xxx.com/rt/REST/1.0&amp;quot; +&lt;br /&gt;
                    &amp;quot;/ticket/new?user=username&amp;amp;pass=password&amp;quot;);&lt;br /&gt;
	    StringBody content = new StringBody(&amp;quot;Queue: General\nSubject: 123&amp;quot;);&lt;br /&gt;
	    MultipartEntity reqEntity = new MultipartEntity();&lt;br /&gt;
	    reqEntity.addPart(&amp;quot;content&amp;quot;, content);&lt;br /&gt;
	    httppost.setEntity(reqEntity);&lt;br /&gt;
	    System.out.println(&amp;quot;executing request &amp;quot; + httppost.getRequestLine());&lt;br /&gt;
            HttpResponse response = httpclient.execute(httppost);&lt;br /&gt;
            HttpEntity resEntity = response.getEntity();&lt;br /&gt;
&lt;br /&gt;
            System.out.println(&amp;quot;----------------------------------------&amp;quot;);&lt;br /&gt;
            System.out.println(response.getStatusLine());&lt;br /&gt;
            if (resEntity != null) {&lt;br /&gt;
                System.out.println(&amp;quot;Response content length: &amp;quot; + resEntity.getContentLength());&lt;br /&gt;
            }&lt;br /&gt;
            EntityUtils.consume(resEntity);&lt;br /&gt;
        } finally {&lt;br /&gt;
            try { httpclient.getConnectionManager().shutdown(); } catch (Exception ignore) {}&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import cookielib&lt;br /&gt;
import urllib&lt;br /&gt;
import urllib2&lt;br /&gt;
       &lt;br /&gt;
# creates a cookie for the rtserver with the credentials given at initialization.&lt;br /&gt;
# define your credentials here&lt;br /&gt;
access_user = &#039;your_login&#039;&lt;br /&gt;
access_password = &#039;your_password&#039;&lt;br /&gt;
       &lt;br /&gt;
# here is the RequestTracker URI we try to access&lt;br /&gt;
uri = &#039;http://your-rt-instance.com/REST/1.0/&#039;&lt;br /&gt;
       &lt;br /&gt;
# trying login on rt server&lt;br /&gt;
cj = cookielib.LWPCookieJar()&lt;br /&gt;
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))&lt;br /&gt;
urllib2.install_opener(opener)&lt;br /&gt;
data = {&#039;user&#039;: access_user, &#039;pass&#039;: access_password}&lt;br /&gt;
ldata = urllib.urlencode(data)&lt;br /&gt;
login = urllib2.Request(uri, ldata)&lt;br /&gt;
try:&lt;br /&gt;
   response = urllib2.urlopen(login)&lt;br /&gt;
   print response.read()&lt;br /&gt;
   print &amp;quot;login successful&amp;quot;&lt;br /&gt;
except urllib2.URLError:&lt;br /&gt;
   # could not connect to server&lt;br /&gt;
   print &amp;quot;Not able to login&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ruby ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env ruby&lt;br /&gt;
require &#039;net/http&#039;&lt;br /&gt;
&lt;br /&gt;
user = &#039;username&#039;&lt;br /&gt;
pass = &#039;password&#039;&lt;br /&gt;
uri = URI(&#039;https://rt.example.com/REST/1.0/ticket/123/show&#039;)&lt;br /&gt;
&lt;br /&gt;
req = Net::HTTP::Post.new(uri.path)&lt;br /&gt;
req.set_form_data(&#039;user&#039; =&amp;gt; user, &#039;pass&#039; =&amp;gt; pass)&lt;br /&gt;
&lt;br /&gt;
res = Net::HTTP.start(uri.hostname, uri.port, &lt;br /&gt;
  :use_ssl =&amp;gt; uri.scheme == &#039;https&#039;, &lt;br /&gt;
  :set_debug_output =&amp;gt; $stderr) do |http|&lt;br /&gt;
  http.request(req)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
case res&lt;br /&gt;
when Net::HTTPSuccess, Net::HTTPRedirection&lt;br /&gt;
  # OK&lt;br /&gt;
  puts &amp;quot;HTTP response code:  #{res.code}&amp;quot;&lt;br /&gt;
  puts &amp;quot;HTTP message: #{res.message}&amp;quot;&lt;br /&gt;
  puts &amp;quot;Response:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  res.each do |key,val|&lt;br /&gt;
    puts &amp;quot;#{key} =&amp;gt; #{val}&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  puts &amp;quot;Data:&amp;quot;&lt;br /&gt;
  puts res.body&lt;br /&gt;
else&lt;br /&gt;
  res.value&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PHP ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$username = rt_user;&lt;br /&gt;
$password = rt_pass;&lt;br /&gt;
$url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/&amp;lt;ticket id&amp;gt;/show?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
$request = new HttpRequest($url, HTTP_METH_GET);&lt;br /&gt;
/* if you want&#039;s to pass additional parameters */&lt;br /&gt;
$request-&amp;gt;addQueryData(array());&lt;br /&gt;
$response = $request-&amp;gt;send();&lt;br /&gt;
print_r($response);&lt;br /&gt;
&amp;lt;/pre&amp;gt; OR&amp;lt;pre&amp;gt;&lt;br /&gt;
$username = rt_user;&lt;br /&gt;
$password = rt_pass;&lt;br /&gt;
$url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/new?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
$request = new HttpRequest($url, HTTP_METH_POST);&lt;br /&gt;
// Note : to add data in custom fields you need to add element like below example&lt;br /&gt;
// in $post_data array&lt;br /&gt;
// Example : \nCF-customfield1:testdata&lt;br /&gt;
$post_data=array(&amp;quot;content&amp;quot;=&amp;gt;&amp;quot;Queue: General\nRequestor: user@domain\nSubject: REST test 1\nOwner: userX\nAdminCc: userX\nText: This is a REST test\n&amp;quot;);&lt;br /&gt;
$request-&amp;gt;addPostFields($post_data);&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
response = $request-&amp;gt;send()-&amp;gt;getBody();&lt;br /&gt;
print_r($response);&lt;br /&gt;
}catch (HttpException $ex) {&lt;br /&gt;
echo $ex;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C# ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Using &amp;quot;WCF REST Starter Kit&amp;quot; (http://msdn.microsoft.com/en-us/netframework/cc950529.aspx)&lt;br /&gt;
using (var client = new HttpClient(&amp;quot;http://rt.site.com/REST/1.0/&amp;quot;))&lt;br /&gt;
{&lt;br /&gt;
   client.TransportSettings.Cookies = new CookieContainer();&lt;br /&gt;
&lt;br /&gt;
   var form = new HttpUrlEncodedForm();&lt;br /&gt;
   form.Add(&amp;quot;user&amp;quot;, &amp;quot;LOGIN&amp;quot;);&lt;br /&gt;
   form.Add(&amp;quot;pass&amp;quot;, &amp;quot;PASSWORD&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
   client.Post(string.Empty, form.CreateHttpContent());&lt;br /&gt;
&lt;br /&gt;
   // 1. Get ticket data&lt;br /&gt;
   using (var request = client.Get(&amp;quot;ticket/1234/show&amp;quot;))&lt;br /&gt;
   {&lt;br /&gt;
      string content = request.Content.ReadAsString();&lt;br /&gt;
      // Some logic&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // 2. Post ticket reply with attachment&lt;br /&gt;
   var formPost = new HttpMultipartMimeForm();&lt;br /&gt;
   byte[] attachment = new byte[];&lt;br /&gt;
   string content = string.Empty;&lt;br /&gt;
         &lt;br /&gt;
   // Store data in attachment&lt;br /&gt;
   // Store data in content string (&amp;quot;Field: Value&amp;quot; line by line)&lt;br /&gt;
   // ...&lt;br /&gt;
         &lt;br /&gt;
   formPost.Add(&amp;quot;content&amp;quot;, content);&lt;br /&gt;
   formPost.Add(&amp;quot;attachment_1&amp;quot;, &amp;quot;attachment_1&amp;quot;, HttpContent.Create(attachment, &amp;quot;application/octet-stream&amp;quot;));&lt;br /&gt;
                             &lt;br /&gt;
   using (var post = client.Post(&amp;quot;ticket/1234/comment&amp;quot;), formPost.CreateHttpContent()))&lt;br /&gt;
      // Some logic&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Powershell (v3)===&lt;br /&gt;
* Escape Powershell reserved chars in user/pass&lt;br /&gt;
* If connecting via SSL, use fqdn of server, not cname&lt;br /&gt;
*Use `n (newline) when composing new ticket structure&lt;br /&gt;
Read RT queue based on query: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$servername=&amp;quot;Your Servername here&amp;quot;&lt;br /&gt;
$u=&amp;quot;user=Username&amp;quot;&lt;br /&gt;
$p=&amp;quot;pass=Password&amp;quot;&lt;br /&gt;
$q=&amp;quot;search/ticket?query=(Status=&#039;open&#039; OR Status=&#039;new&#039;) AND (Queue=&#039;GENERAL&#039; OR Queue=&#039;FOO&#039;) AND Owner=&#039;Nobody&#039;&amp;quot;&lt;br /&gt;
$uri=&amp;quot;https://&amp;quot; + $servername + &amp;quot;/rt/REST/1.0/&amp;quot; + $q + &amp;quot;&amp;amp;&amp;quot; + $u + &amp;quot;&amp;amp;&amp;quot; + $p&lt;br /&gt;
$RT=Invoke-WebRequest -Uri  $uri -SessionVariable sess&lt;br /&gt;
$rt.Content&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===VB.NET===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Public Sub AddAttachmentToRT(ByVal url As String, ByVal fileName As String, ByVal filePath As String)&lt;br /&gt;
&lt;br /&gt;
        Dim dataBoundary As String = &amp;quot;--xYzZY&amp;quot;&lt;br /&gt;
        Dim request As HttpWebRequest&lt;br /&gt;
        Dim fileType As String = &amp;quot;image/jpeg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        &#039;Create a POST web request to the REST interface using the passed URL&lt;br /&gt;
        request = CType(WebRequest.Create(url), HttpWebRequest)&lt;br /&gt;
        request.ContentType = &amp;quot;multipart/form-data; boundary=xYzZY&amp;quot;&lt;br /&gt;
        request.Method = &amp;quot;POST&amp;quot;&lt;br /&gt;
        request.KeepAlive = True&lt;br /&gt;
&lt;br /&gt;
        &#039;Write the request to the requestStream&lt;br /&gt;
        Using requestStream As IO.Stream = request.GetRequestStream()&lt;br /&gt;
&lt;br /&gt;
            &#039;Create a variable &amp;quot;attachment_1&amp;quot; in the POST, specify the file name and file type&lt;br /&gt;
            Dim preAttachment As String = dataBoundary + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Disposition: form-data; name=&amp;quot;&amp;quot;attachment_1&amp;quot;&amp;quot;; filename=&amp;quot;&amp;quot;&amp;quot; + fileName + &amp;quot;&amp;quot;&amp;quot;&amp;quot; + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Type: &amp;quot; + fileType + vbCrLf _&lt;br /&gt;
            + vbCrLf&lt;br /&gt;
&lt;br /&gt;
            &#039;Convert this preAttachment string to bytes&lt;br /&gt;
            Dim preAttachmentBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(preAttachment)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write this preAttachment string to the stream&lt;br /&gt;
            requestStream.Write(preAttachmentBytes, 0, preAttachmentBytes.Length)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write the file as bytes to the stream by passing its exact location&lt;br /&gt;
            Using fileStream As New IO.FileStream(Server.MapPath(filePath + fileName), IO.FileMode.Open, IO.FileAccess.Read)&lt;br /&gt;
&lt;br /&gt;
                Dim buffer(4096) As Byte&lt;br /&gt;
                Dim bytesRead As Int32 = fileStream.Read(buffer, 0, buffer.Length)&lt;br /&gt;
&lt;br /&gt;
                Do While (bytesRead &amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
                    requestStream.Write(buffer, 0, bytesRead)&lt;br /&gt;
                    bytesRead = fileStream.Read(buffer, 0, buffer.Length)&lt;br /&gt;
&lt;br /&gt;
                Loop&lt;br /&gt;
&lt;br /&gt;
            End Using&lt;br /&gt;
&lt;br /&gt;
            &#039;Create a variable named content in the POST, specify the attachment name and comment text&lt;br /&gt;
            Dim postAttachment As String = vbCrLf _&lt;br /&gt;
            + dataBoundary + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Disposition: form-data; name=&amp;quot;&amp;quot;content&amp;quot;&amp;quot;&amp;quot; + vbCrLf _&lt;br /&gt;
            + vbCrLf _&lt;br /&gt;
            + &amp;quot;Action: comment&amp;quot; + vbLf _&lt;br /&gt;
            + &amp;quot;Attachment: &amp;quot; + fileName + vbCrLf _&lt;br /&gt;
            + &amp;quot;Text: Whatever You Want&amp;quot; + vbCrLf _&lt;br /&gt;
            + vbCrLf _&lt;br /&gt;
            + &amp;quot;--xYzZY--&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            &#039;Convert postAttachment string to bytes&lt;br /&gt;
            Dim postAttachmentBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(postAttachment)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write the postAttachment string to the stream&lt;br /&gt;
            requestStream.Write(postAttachmentBytes, 0, postAttachmentBytes.Length)&lt;br /&gt;
&lt;br /&gt;
        End Using&lt;br /&gt;
&lt;br /&gt;
        Dim response As Net.WebResponse = Nothing&lt;br /&gt;
&lt;br /&gt;
        &#039;Get the response from our REST request to RT&lt;br /&gt;
        &#039;Required to capture response, without this Try-Catch attaching will fail&lt;br /&gt;
        Try&lt;br /&gt;
            response = request.GetResponse()&lt;br /&gt;
&lt;br /&gt;
            Using responseStream As IO.Stream = response.GetResponseStream()&lt;br /&gt;
&lt;br /&gt;
                Using responseReader As New IO.StreamReader(responseStream)&lt;br /&gt;
&lt;br /&gt;
                    Dim responseText = responseReader.ReadToEnd()&lt;br /&gt;
&lt;br /&gt;
                End Using&lt;br /&gt;
&lt;br /&gt;
            End Using&lt;br /&gt;
&lt;br /&gt;
        Catch exception As Net.WebException&lt;br /&gt;
&lt;br /&gt;
            response = exception.Response&lt;br /&gt;
&lt;br /&gt;
            If (response IsNot Nothing) Then&lt;br /&gt;
&lt;br /&gt;
                Using reader As New IO.StreamReader(response.GetResponseStream())&lt;br /&gt;
&lt;br /&gt;
                    Dim responseText = reader.ReadToEnd()&lt;br /&gt;
&lt;br /&gt;
                End Using&lt;br /&gt;
&lt;br /&gt;
                response.Close()&lt;br /&gt;
&lt;br /&gt;
            End If&lt;br /&gt;
&lt;br /&gt;
        Finally&lt;br /&gt;
&lt;br /&gt;
            request = Nothing&lt;br /&gt;
&lt;br /&gt;
        End Try&lt;br /&gt;
&lt;br /&gt;
    End Sub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===JavaScript===&lt;br /&gt;
This is an example of updating the RefersTo field for a ticket. Assuming Zepto/jQuery is also being used.&lt;br /&gt;
 function link_back(url, ticket_num, rt) {&lt;br /&gt;
     var data, link;&lt;br /&gt;
     link = &amp;quot;refersto: &amp;quot; + url;&lt;br /&gt;
     data = {&amp;quot;content&amp;quot;: link};&lt;br /&gt;
 &lt;br /&gt;
     $.ajax({&lt;br /&gt;
         type: &amp;quot;POST&amp;quot;,&lt;br /&gt;
         url: rt + ticket_num + &amp;quot;/links&amp;quot;,&lt;br /&gt;
         data: data,&lt;br /&gt;
         success: function (reply) {&lt;br /&gt;
             console.log(reply);&lt;br /&gt;
         }&lt;br /&gt;
     });&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 var url = &amp;quot;https://www.wikipedia.org/&amp;quot;;&lt;br /&gt;
 var ticket_num = &amp;quot;123456&amp;quot;;&lt;br /&gt;
 var rt = &amp;quot;https://some.rt.url/REST/1.0/ticket/&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 link_back(url, ticket_num, rt);&lt;br /&gt;
&lt;br /&gt;
== Convenience libraries ==&lt;br /&gt;
&lt;br /&gt;
There are libraries which do much of the low-level work shown in the examples below for you, and provide an easier programming interface for dealing with RT:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Language&lt;br /&gt;
!Package/Module&lt;br /&gt;
!Source&lt;br /&gt;
!Example&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Perl&#039;&#039;&#039;&lt;br /&gt;
|[http://metacpan.org/module/RT::Client::REST RT::Client::REST]&lt;br /&gt;
|[http://rt-client-rest.googlecode.com/svn/trunk/ Google Code]&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;quot;perl -MCPAN -e install RT::Client::REST&amp;quot;&amp;lt;/code&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Ruby&#039;&#039;&#039;&lt;br /&gt;
|[http://rubygems.org/gems/rt-client rt-client]&lt;br /&gt;
|[https://github.com/uidzip/rt-client GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;gem install rt-client&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Ruby&#039;&#039;&#039;&lt;br /&gt;
|[http://rubygems.org/gems/roart Roart]&lt;br /&gt;
|[https://github.com/pjdavis/roart GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;gem install roart&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/Rickerd0613/rtapi rtapi]&lt;br /&gt;
|[https://github.com/Rickerd0613/rtapi GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;pip install rtapi&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/z4r/python-rtkit rtkit]&lt;br /&gt;
|[https://github.com/z4r/python-rtkit GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;pip install python-rtkit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/CZ-NIC/python-rt python-rt]&lt;br /&gt;
|[https://github.com/CZ-NIC/python-rt Github]&lt;br /&gt;
|&amp;lt;code&amp;gt;pip install rt&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Java&#039;&#039;&#039;&lt;br /&gt;
|[http://projects.boksa.de/RT-REST/ RT-REST]&lt;br /&gt;
|[https://github.com/bboksa/RT-REST GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;N/A&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;PHP&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/dersam/RTPHPLib RTPHPLib]&lt;br /&gt;
|[https://github.com/dersam/RTPHPLib GitHub]&lt;br /&gt;
|composer require dersam/rt-php-lib&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Main_Page&amp;diff=26911</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Main_Page&amp;diff=26911"/>
		<updated>2019-05-02T17:07:15Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== RT ==&lt;br /&gt;
&lt;br /&gt;
RT is an open source issue tracking and workflow platform developed and supported by [https://bestpractical.com Best Practical Solutions]. This wiki site is a free resource for the RT community to share ideas, configurations, and customizations to RT, RTIR, and related products.&lt;br /&gt;
&lt;br /&gt;
== About RT Documentation ==&lt;br /&gt;
&lt;br /&gt;
In addition to the information found here, you can find RT&#039;s documentation in your install of RT on the server and also [https://bestpractical.com/resources/ on the web at the Best Practical website]. The [https://bestpractical.com/blog Best Practical blog] and the [https://forum.bestpractical.com Community Forum] are also great resources for RT information. Best Practical also offers commercial support services to help get the most out of RT and RTIR.&lt;br /&gt;
&lt;br /&gt;
This site is a [https://en.wikipedia.org/wiki/Wiki wiki], like Wikipedia, which means you can edit it right in your browser. If you use RT and have found it valuable, [[UpdateTheWiki]], post your hints, tricks, tips and tools about how to get the most out of RT. If you currently use RT, please head over to [[RTUsers]] and add yourself and your organization to the user list.&lt;br /&gt;
&lt;br /&gt;
== Getting Started with RT ==&lt;br /&gt;
&lt;br /&gt;
If you&#039;re new to RT, start with the [[UserManual]]. We also have a page with [[Videos]] with introductory and more advanced features.&lt;br /&gt;
&lt;br /&gt;
== Current Sections ==&lt;br /&gt;
&lt;br /&gt;
You can go through these pretty much in order if you&#039;re starting from scratch, but please plan to spend some quality time with the [[UserManual]] before you try to go live; RT is big and full of tons of features, and you probably can&#039;t get your head around all of it in one sitting.&lt;br /&gt;
&lt;br /&gt;
* [[UserManual]]&lt;br /&gt;
* [[Demo]]&lt;br /&gt;
* [[REST]] API&lt;br /&gt;
&lt;br /&gt;
== Historical Sections ==&lt;br /&gt;
&lt;br /&gt;
RT has been in development for over 20 years, so information on this wiki dates back to many different versions. These sections may contain information on older versions of RT that is no longer completely accurate for modern RT. Pages known to be updated should be moved up to the Current Section.&lt;br /&gt;
&lt;br /&gt;
* [[FAQ]], [[FindingAnswersAboutRT]] and &amp;quot;Common Problems&amp;quot; below.&lt;br /&gt;
* [[BugReporting]]&lt;br /&gt;
* [[HowToHelp]], [[Translation]]&lt;br /&gt;
&lt;br /&gt;
* [[RTGlossary]] &amp;amp;amp; [[Documentation]]&lt;br /&gt;
* [[InstallationGuides]], [[RTTutorials]]&lt;br /&gt;
* [[RT Config|RT_Config]] &amp;amp;amp; [[RT SiteConfig|RT_SiteConfig]]&lt;br /&gt;
&lt;br /&gt;
* [[Extensions]] to RT available as installable plugins&lt;br /&gt;
* [[Contributions]] by the community to customize RT&lt;br /&gt;
* [[RTIR]] RT for Incident Response&lt;br /&gt;
* [[RTFM]] RT FAQ Manager&lt;br /&gt;
&lt;br /&gt;
* [[RTHistory]]&lt;br /&gt;
* [[InThePress]]&lt;br /&gt;
* Customizing with [[CustomizingWithCallbacks|Callbacks]]&lt;br /&gt;
&lt;br /&gt;
=== Common problems ===&lt;br /&gt;
&lt;br /&gt;
* [[CantLocateObject]] - Can&#039;t locate object method &amp;quot;new&amp;quot; via package &amp;quot;&amp;lt;code&amp;gt;RT::Handle&amp;lt;/code&amp;gt;&amp;quot; at rt3/lib/RT.pm&lt;br /&gt;
* [[NoConnectionToSyslog]] - no connection to syslog&lt;br /&gt;
* [[NoRecipFound]] - No recipients found. Not sending&lt;br /&gt;
* Getting information out of RT3 for [[reporting]] or inclusion elsewhere.&lt;br /&gt;
* [[PermissionDenied]] emails|&lt;br /&gt;
* Getting RT4.x to play nice with [[certbot]] to obtain free SSL certificates from [http://letsencrypt.org LetsEncrypt].&lt;br /&gt;
&lt;br /&gt;
== Wish lists ==&lt;br /&gt;
&lt;br /&gt;
* [[WikiWishList]] - wish list for this wiki&lt;br /&gt;
* [[WishList]] - wish list for the RT&lt;br /&gt;
* [[RT3StatisticsPackageWishList]]&lt;br /&gt;
&lt;br /&gt;
== Getting started with MediaWiki ==&lt;br /&gt;
&lt;br /&gt;
To learn more about how to edit wiki pages, click the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Help] link here or in the navigation on the left.&lt;br /&gt;
&lt;br /&gt;
We have installed the Markdown plugin, so you can edit pages in Markdown.&lt;br /&gt;
&lt;br /&gt;
Several years ago, we moved the wiki from Wikia as noted on the [[Wikia Move]] page.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Main_Page&amp;diff=26910</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Main_Page&amp;diff=26910"/>
		<updated>2019-05-02T17:06:21Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: /* Current Sections */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== RT ==&lt;br /&gt;
&lt;br /&gt;
RT is an open source issue tracking and workflow platform developed and supported by [https://bestpractical.com Best Practical Solutions]. This wiki site is a free resource for the RT community to share ideas, configurations, and customizations to RT, RTIR, and related products.&lt;br /&gt;
&lt;br /&gt;
== About RT Documentation ==&lt;br /&gt;
&lt;br /&gt;
In addition to the information found here, you can find RT&#039;s documentation in your install of RT on the server and also [https://bestpractical.com/resources/ on the web at the Best Practical website]. The [https://bestpractical.com/blog Best Practical blog] and the [https://forum.bestpractical.com Community Forum] are also great resources for RT information. Best Practical also offers commercial support services to help get the most out of RT and RTIR.&lt;br /&gt;
&lt;br /&gt;
This site is a [https://en.wikipedia.org/wiki/Wiki wiki], like Wikipedia, which means you can edit it right in your browser. If you use RT and have found it valuable, [[UpdateTheWiki]], post your hints, tricks, tips and tools about how to get the most out of RT. If you currently use RT, please head over to [[RTUsers]] and add yourself and your organization to the user list.&lt;br /&gt;
&lt;br /&gt;
== Getting Started with RT ==&lt;br /&gt;
&lt;br /&gt;
If you&#039;re new to RT, start with the [[UserManual]]. We also have a page with [[Videos]] with introductory and more advanced features.&lt;br /&gt;
&lt;br /&gt;
== Current Sections ==&lt;br /&gt;
&lt;br /&gt;
You can go through these pretty much in order if you&#039;re starting from scratch, but please plan to spend some quality time with the [[UserManual]] before you try to go live; RT is big and full of tons of features, and you probably can&#039;t get your head around all of it in one sitting.&lt;br /&gt;
&lt;br /&gt;
* [[UserManual]]&lt;br /&gt;
* [[Demo]]&lt;br /&gt;
&lt;br /&gt;
== Historical Sections ==&lt;br /&gt;
&lt;br /&gt;
RT has been in development for over 20 years, so information on this wiki dates back to many different versions. These sections may contain information on older versions of RT that is no longer completely accurate for modern RT. Pages known to be updated should be moved up to the Current Section.&lt;br /&gt;
&lt;br /&gt;
* [[FAQ]], [[FindingAnswersAboutRT]] and &amp;quot;Common Problems&amp;quot; below.&lt;br /&gt;
* [[BugReporting]]&lt;br /&gt;
* [[HowToHelp]], [[Translation]]&lt;br /&gt;
&lt;br /&gt;
* [[RTGlossary]] &amp;amp;amp; [[Documentation]]&lt;br /&gt;
* [[InstallationGuides]], [[RTTutorials]]&lt;br /&gt;
* [[RT Config|RT_Config]] &amp;amp;amp; [[RT SiteConfig|RT_SiteConfig]]&lt;br /&gt;
&lt;br /&gt;
* [[Extensions]] to RT available as installable plugins&lt;br /&gt;
* [[Contributions]] by the community to customize RT&lt;br /&gt;
* [[RTIR]] RT for Incident Response&lt;br /&gt;
* [[RTFM]] RT FAQ Manager&lt;br /&gt;
&lt;br /&gt;
* [[RTHistory]]&lt;br /&gt;
* [[InThePress]]&lt;br /&gt;
* [[REST]] API&lt;br /&gt;
* Customizing with [[CustomizingWithCallbacks|Callbacks]]&lt;br /&gt;
&lt;br /&gt;
=== Common problems ===&lt;br /&gt;
&lt;br /&gt;
* [[CantLocateObject]] - Can&#039;t locate object method &amp;quot;new&amp;quot; via package &amp;quot;&amp;lt;code&amp;gt;RT::Handle&amp;lt;/code&amp;gt;&amp;quot; at rt3/lib/RT.pm&lt;br /&gt;
* [[NoConnectionToSyslog]] - no connection to syslog&lt;br /&gt;
* [[NoRecipFound]] - No recipients found. Not sending&lt;br /&gt;
* Getting information out of RT3 for [[reporting]] or inclusion elsewhere.&lt;br /&gt;
* [[PermissionDenied]] emails|&lt;br /&gt;
* Getting RT4.x to play nice with [[certbot]] to obtain free SSL certificates from [http://letsencrypt.org LetsEncrypt].&lt;br /&gt;
&lt;br /&gt;
== Wish lists ==&lt;br /&gt;
&lt;br /&gt;
* [[WikiWishList]] - wish list for this wiki&lt;br /&gt;
* [[WishList]] - wish list for the RT&lt;br /&gt;
* [[RT3StatisticsPackageWishList]]&lt;br /&gt;
&lt;br /&gt;
== Getting started with MediaWiki ==&lt;br /&gt;
&lt;br /&gt;
To learn more about how to edit wiki pages, click the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Help] link here or in the navigation on the left.&lt;br /&gt;
&lt;br /&gt;
We have installed the Markdown plugin, so you can edit pages in Markdown.&lt;br /&gt;
&lt;br /&gt;
Several years ago, we moved the wiki from Wikia as noted on the [[Wikia Move]] page.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=UpdateTheWiki&amp;diff=26906</id>
		<title>UpdateTheWiki</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=UpdateTheWiki&amp;diff=26906"/>
		<updated>2019-04-03T12:51:19Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Updating the wiki is very easy.&lt;br /&gt;
&lt;br /&gt;
== Request an Account ==&lt;br /&gt;
&lt;br /&gt;
There is a link in the upper righthand corner to [[Special:RequestAccount]] which allows you to request an account. Once approved, you can then log in and make updates. (We used to allow self-signup, but the wiki spam was a huge problem so now we approve accounts first.)&lt;br /&gt;
&lt;br /&gt;
== Edit existing pages ==&lt;br /&gt;
&lt;br /&gt;
* Click the Edit link at the top of the page or on any section.&lt;br /&gt;
* Edit the page contents and click save.&lt;br /&gt;
* If presented with a simple question about RT, answer it. This helps us keep the wiki spam to a minimum.&lt;br /&gt;
&lt;br /&gt;
== Add new pages ==&lt;br /&gt;
&lt;br /&gt;
* Click the edit link on the page where you want to add the first link to the new page.&lt;br /&gt;
* Add [[CamelCaseNameOfNewPage]] to the text of the page and click save. ([http://en.wikipedia.org/wiki/CamelCase What&#039;s CamelCase?]).&lt;br /&gt;
* You should see [[CamelCaseNameOfNewPage]] as a red link.&lt;br /&gt;
* Click this link and you will see a create box for the new page.&lt;br /&gt;
&lt;br /&gt;
If name of the new page doesn&#039;t match [[CamelCase]] notation, like REST or Ticket use [[REST]] or [[Ticket]].&lt;br /&gt;
&lt;br /&gt;
You can use the following trick as well:&lt;br /&gt;
&lt;br /&gt;
* In the URL string of your browser write https://rt-wiki.bestpractical.com/wiki/NameOfNewPage&lt;br /&gt;
* Hit enter and you&#039;ll seeing a page that already exists or a page that gives you the option to create a new page. Click the links to do that.&lt;br /&gt;
* This trick has a trade-off, as a new page is not linked to from any other page. People can only find it with the search box, so you have to add links later.&lt;br /&gt;
&lt;br /&gt;
Additional information:&lt;br /&gt;
&lt;br /&gt;
* [[WikiWishList]] - wish list for the RT Wiki&lt;br /&gt;
* [[LowHangingFruit]] - improvements to wiki formatting which do not require extensive knowledge of RT.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Videos&amp;diff=26893</id>
		<title>Videos</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Videos&amp;diff=26893"/>
		<updated>2019-04-01T12:13:12Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: Created page with &amp;quot;Some great videos are available, some by Best Practical and some by RT users.  == RT ==  === Four Part Intro Series from SNAFU ===  * [https://youtu.be/ZO_uVLsWXiE Part 1: Bas...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some great videos are available, some by Best Practical and some by RT users.&lt;br /&gt;
&lt;br /&gt;
== RT ==&lt;br /&gt;
&lt;br /&gt;
=== Four Part Intro Series from SNAFU ===&lt;br /&gt;
&lt;br /&gt;
* [https://youtu.be/ZO_uVLsWXiE Part 1: Basic Intro]&lt;br /&gt;
* [https://youtu.be/YCYL8eGmXlE Part 2: Working on Tickets]&lt;br /&gt;
* [https://youtu.be/G8GRftBTndE Part 3: Bulk Updates and Merging]&lt;br /&gt;
* [https://youtu.be/7ltRWqm-TSI Part 4: Updating Tickets, Navigation, Your Signature]&lt;br /&gt;
&lt;br /&gt;
=== University of Washington Tips and Tricks ===&lt;br /&gt;
&lt;br /&gt;
* [https://www.youtube.com/watch?v=YD1fSE105Bc University of Washington RT Tips and Tricks]&lt;br /&gt;
&lt;br /&gt;
=== Best Practical Videos ===&lt;br /&gt;
&lt;br /&gt;
* [https://www.youtube.com/watch?v=aBwYK1a8W7U Attachment Handling]&lt;br /&gt;
* [https://www.youtube.com/watch?v=45q3edmNz0s Default Ticket Values]&lt;br /&gt;
* [https://www.youtube.com/watch?v=2_F2G6D6BxQ Asset Management in RT]&lt;br /&gt;
* [https://www.youtube.com/watch?v=gGKWOxb0nIQ Managing SLAs]&lt;br /&gt;
&lt;br /&gt;
== RTIR ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.youtube.com/watch?v=we8nDQozeCU RTIR Tour]&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Main_Page&amp;diff=26892</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Main_Page&amp;diff=26892"/>
		<updated>2019-04-01T12:08:32Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== RT ==&lt;br /&gt;
&lt;br /&gt;
RT is an open source issue tracking and workflow platform developed and supported by [https://bestpractical.com Best Practical Solutions]. This wiki site is a free resource for the RT community to share ideas, configurations, and customizations to RT, RTIR, and related products.&lt;br /&gt;
&lt;br /&gt;
== About RT Documentation ==&lt;br /&gt;
&lt;br /&gt;
In addition to the information found here, you can find RT&#039;s documentation in your install of RT on the server and also [https://bestpractical.com/resources/ on the web at the Best Practical website]. The [https://bestpractical.com/blog Best Practical blog] and the [https://forum.bestpractical.com Community Forum] are also great resources for RT information. Best Practical also offers commercial support services to help get the most out of RT and RTIR.&lt;br /&gt;
&lt;br /&gt;
This site is a [https://en.wikipedia.org/wiki/Wiki wiki], like Wikipedia, which means you can edit it right in your browser. If you use RT and have found it valuable, [[UpdateTheWiki]], post your hints, tricks, tips and tools about how to get the most out of RT. If you currently use RT, please head over to [[RTUsers]] and add yourself and your organization to the user list.&lt;br /&gt;
&lt;br /&gt;
== Getting Started with RT ==&lt;br /&gt;
&lt;br /&gt;
If you&#039;re new to RT, start with the [[UserManual]]. We also have a page with [[Videos]] with introductory and more advanced features.&lt;br /&gt;
&lt;br /&gt;
== Current Sections ==&lt;br /&gt;
&lt;br /&gt;
You can go through these pretty much in order if you&#039;re starting from scratch, but please plan to spend some quality time with the [[UserManual]] before you try to go live; RT is big and full of tons of features, and you probably can&#039;t get your head around all of it in one sitting.&lt;br /&gt;
&lt;br /&gt;
* [[Demo]]&lt;br /&gt;
&lt;br /&gt;
== Historical Sections ==&lt;br /&gt;
&lt;br /&gt;
RT has been in development for over 20 years, so information on this wiki dates back to many different versions. These sections may contain information on older versions of RT that is no longer completely accurate for modern RT. Pages known to be updated should be moved up to the Current Section.&lt;br /&gt;
&lt;br /&gt;
* [[FAQ]], [[FindingAnswersAboutRT]] and &amp;quot;Common Problems&amp;quot; below.&lt;br /&gt;
* [[BugReporting]]&lt;br /&gt;
* [[HowToHelp]], [[Translation]]&lt;br /&gt;
&lt;br /&gt;
* [[RTGlossary]] &amp;amp;amp; [[Documentation]]&lt;br /&gt;
* [[InstallationGuides]], [[RTTutorials]]&lt;br /&gt;
* [[RT Config|RT_Config]] &amp;amp;amp; [[RT SiteConfig|RT_SiteConfig]]&lt;br /&gt;
&lt;br /&gt;
* [[Extensions]] to RT available as installable plugins&lt;br /&gt;
* [[Contributions]] by the community to customize RT&lt;br /&gt;
* [[RTIR]] RT for Incident Response&lt;br /&gt;
* [[RTFM]] RT FAQ Manager&lt;br /&gt;
&lt;br /&gt;
* [[RTHistory]]&lt;br /&gt;
* [[InThePress]]&lt;br /&gt;
* [[REST]] API&lt;br /&gt;
* Customizing with [[CustomizingWithCallbacks|Callbacks]]&lt;br /&gt;
&lt;br /&gt;
=== Common problems ===&lt;br /&gt;
&lt;br /&gt;
* [[CantLocateObject]] - Can&#039;t locate object method &amp;quot;new&amp;quot; via package &amp;quot;&amp;lt;code&amp;gt;RT::Handle&amp;lt;/code&amp;gt;&amp;quot; at rt3/lib/RT.pm&lt;br /&gt;
* [[NoConnectionToSyslog]] - no connection to syslog&lt;br /&gt;
* [[NoRecipFound]] - No recipients found. Not sending&lt;br /&gt;
* Getting information out of RT3 for [[reporting]] or inclusion elsewhere.&lt;br /&gt;
* [[PermissionDenied]] emails|&lt;br /&gt;
* Getting RT4.x to play nice with [[certbot]] to obtain free SSL certificates from [http://letsencrypt.org LetsEncrypt].&lt;br /&gt;
&lt;br /&gt;
== Wish lists ==&lt;br /&gt;
&lt;br /&gt;
* [[WikiWishList]] - wish list for this wiki&lt;br /&gt;
* [[WishList]] - wish list for the RT&lt;br /&gt;
* [[RT3StatisticsPackageWishList]]&lt;br /&gt;
&lt;br /&gt;
== Getting started with MediaWiki ==&lt;br /&gt;
&lt;br /&gt;
To learn more about how to edit wiki pages, click the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Help] link here or in the navigation on the left.&lt;br /&gt;
&lt;br /&gt;
We have installed the Markdown plugin, so you can edit pages in Markdown.&lt;br /&gt;
&lt;br /&gt;
Several years ago, we moved the wiki from Wikia as noted on the [[Wikia Move]] page.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualUsingWebInterface&amp;diff=26876</id>
		<title>ManualUsingWebInterface</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualUsingWebInterface&amp;diff=26876"/>
		<updated>2019-03-28T20:37:12Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualBasicAdministration]] --- Up: [[UserManual]] --- Next: [[ManualAdministration]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
RT has a web interface that works in just about every web browser - including screen readers for the blind - and is easy to use. How easy? You&#039;re about to find out. Remember, though, that RT is very configurable; if you&#039;re reading this to learn how to use a local installation at your site, remember that your administrator could have made changes that will make things look differently than they do here; don&#039;t let it throw you.&lt;br /&gt;
&lt;br /&gt;
RT has a powerful interface to create queries using [[TicketSQL]], a SQL-like syntax for searching tickets. The output format can also be configured. i.e. which columns to show. This can be configured using the query builder or a plain text input in advanced mode.&lt;br /&gt;
&lt;br /&gt;
If you see any unfamiliar terms in this chapter, look for them in the RT Concepts section of [[ManualIntroduction]], or in [[RTGlossary]].&lt;br /&gt;
&lt;br /&gt;
This manual is being updated to 4.4; we&#039;re going to snip out references to things that were markedly different in older -- particularly pre-4.x -- releases. If you have one of those... you &#039;&#039;&#039;really&#039;&#039;&#039; need to think about upgrading.&lt;br /&gt;
&lt;br /&gt;
= Logging In =&lt;br /&gt;
&lt;br /&gt;
Your administrator will tell you where your login page is, and what username and (usually) temporary password to use. The login screen looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:RT-Login.png|RT Login Page|thumb|500px]]&lt;br /&gt;
&lt;br /&gt;
Type your username in the Username text box, type your password in the Password text box, and then click the Login button, or hit ENTER.&lt;br /&gt;
&lt;br /&gt;
= RT at a Glance (Home Page) =&lt;br /&gt;
&lt;br /&gt;
Immediately after logging in, you&#039;ll be looking at the home page, RT at a Glance.&lt;br /&gt;
&lt;br /&gt;
[[File:RT-at-a-Glance.png|RT at a Glance|thumb|500px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You&#039;ll find that many items are clickable hotlinks in the RT interface, such as ticket ids and queues, but the default interface configuration does not highlight these using the usual blue color or underline. Move your mouse around; things which are links will get an underline when you hover the mouse over them. Clicking on these items takes you pretty much where you might expect it would.&lt;br /&gt;
&lt;br /&gt;
Also, note that your installation may have been customized by the administrator, and because of that, things may be in different places than we describe here.&lt;br /&gt;
&lt;br /&gt;
The main part of the page, called &amp;quot;RT at a Glance&amp;quot;, will contain a collection of panels, each of which can be minimized, and some of which can also be edited.&lt;br /&gt;
&lt;br /&gt;
By default, these are:&lt;br /&gt;
&lt;br /&gt;
== In the left column ==&lt;br /&gt;
&lt;br /&gt;
* 10 highest priority tickets I own: This section displays what you need to do. Each ticket will display its id, subject, queue, and status from this page. Click any ticket&#039;s id or description to display its basic information page (see also the [[ManualUsingWebInterface#Tickets_interface|Tickets interface]] section of this chapter).&lt;br /&gt;
* 10 newest unowned tickets: Here you&#039;ll see the list of tickets which have been created, but not yet assigned to anyone, sorted with the newest ones at the top. Each ticket has an associated &#039;&#039;&#039;Take&#039;&#039;&#039; link which you can use to assign the ownership of the ticket to yourself, and start working on it.&lt;br /&gt;
* Bookmarked tickets: Here is a facility where you can bookmark any ticket while you&#039;re looking at it, no matter its queue or owner, by clicking on an empty star in the top right corner of the page. Tickets you&#039;ve bookmarked in this way will be displayed in this panel.&lt;br /&gt;
* Quick Ticket Creation: This panel lets you enter the bare minimum of information about a new ticket, to create one quickly when necessary. If you need to enter more information about a new ticket, including things like [[CCs]], select a queue from the top submenu of the page, and click the &amp;quot;New Ticket In&amp;quot; button; this will give you the complete New Ticket screen.&lt;br /&gt;
&lt;br /&gt;
== In the right column ==&lt;br /&gt;
&lt;br /&gt;
* My Reminders - If you have set a reminder for yourself in a ticket, you will see the title of the reminder and which ticket it belongs to. Click on the title of the reminder to follow it.&lt;br /&gt;
* Queue List - This panel contains a list of all the queues you&#039;re permitted to access, logged in with the current user account. They&#039;re in alphabetical order, and show tickets in each status based on the queue lifecycle.&lt;br /&gt;
* Dashboards: The Dashboards panel (see [[ManualDashboards]]) will contain a list of any Dashboards which have been created for the entire RT installation, your user group, or your personally created dashboards.&lt;br /&gt;
* Refresh: This pulldown menu, on the lower right side of the screen, lets you select whether the homepage is automatically refreshed or not. The default is no. Other options are refreshing the page every 2, 5, 10, 20, 60, and 120 minutes. Click the Go! button to select the displayed auto-refresh delay.&lt;br /&gt;
&lt;br /&gt;
== Top navigation bar ==&lt;br /&gt;
&lt;br /&gt;
This is the RT main menu. The options will expand into a menu tree as you select various tasks. Your current location in this tree will always be boldfaced. Some of these options may not be displayed if you do not have the appropriate rights.&lt;br /&gt;
&lt;br /&gt;
* Home: the home page: where you are now. You can always get back to the home page by clicking Home in the upper left of the screen. You can even click this if you&#039;re &#039;&#039;&#039;on&#039;&#039;&#039; the home page, as an easy Refresh link.&lt;br /&gt;
* Search: clicking this brings you to the ticket search query builder page (see also [[ManualUsingWebInterface#Searching_for_tickets|Searching for tickets]]).&lt;br /&gt;
* Reports: This allows you to quickly create reports on tickets Resolved by owner, Resolved in date range or Created in a date range. &lt;br /&gt;
* Articles: clicking this takes you to Articles, RT&#039;s integrated knowledgebase.&lt;br /&gt;
* Assets: Assets allow you to keep an inventory of items that can then be linked to tickets as needed&lt;br /&gt;
* Tools: The options here allow you to view your daily progress, check your reminder and view any approvals you may need&lt;br /&gt;
* Admin: This link takes administrators to the section of RT where they can configure users, queues and scrips, and make global setup changes to the installation.&lt;br /&gt;
* Logged in as: This menu lets you configure RT for your personal tastes. You can also log out of RT here.&lt;br /&gt;
&lt;br /&gt;
== Top submenu ==&lt;br /&gt;
&lt;br /&gt;
* New ticket in: Use this to quickly start creating a ticket (for more detail, see [[ManualUsingWebInterface#Creating_a_new_ticket|Creating a new ticket]]). Choose a queue from the drop-down menu and click the &amp;quot;New ticket in:&amp;quot; button to begin.&lt;br /&gt;
* Search: Type a search term in the text box and click the Search button to find tickets. This box can do some magic, for example you can type in a ticket id, and jump directly to that ticket. Check out [[ManualSimpleSearch]] for more on the magic and [[ManualSearchTickets]] for more ways to search tickets.&lt;br /&gt;
&lt;br /&gt;
= Tickets interface =&lt;br /&gt;
&lt;br /&gt;
The fundamental object in RT is the ticket; a ticket groups all of the information about, and transactions related to, an issue you&#039;re using RT to track.&lt;br /&gt;
&lt;br /&gt;
First, you should know some of the various ways to navigate to an existing ticket:&lt;br /&gt;
&lt;br /&gt;
* from the Home page, click a ticket subject under &#039;&#039;&#039;10 highest priority tickets I own&#039;&#039;&#039; or &#039;&#039;&#039;10 newest unowned tickets&#039;&#039;&#039;. Or, you can &#039;&#039;&#039;Take&#039;&#039;&#039; an unowned ticket, which has the extra side effect of assigning ownership to you.&lt;br /&gt;
* search for a ticket, from the search box on the Home page or by clicking Search in the top navigation bar, then click on the ticket.&lt;br /&gt;
* click a queue name on the Queue List panel and then click a ticket.&lt;br /&gt;
* clicking a ticket&#039;s URL from within an email message.&lt;br /&gt;
&lt;br /&gt;
= Display =&lt;br /&gt;
&lt;br /&gt;
Any way you navigate to a ticket, you&#039;ll arrive at that ticket&#039;s Display page first.&lt;br /&gt;
&lt;br /&gt;
The Display view, the first of many possible views of the ticket, (see screenshot) provides an overview of the ticket.&lt;br /&gt;
&lt;br /&gt;
[[File:Ticket-Display.png|Ticket Display Page|thumb|500px]]&lt;br /&gt;
&lt;br /&gt;
Two panes come up on the Display view: Ticket Metadata on top, and History below.&lt;br /&gt;
&lt;br /&gt;
As you can see, it includes information like Basics, People, Reminders, Dates, and Links, each in it&#039;s own portlet.&lt;br /&gt;
&lt;br /&gt;
The id and subject of the ticket is above the top command bar.&lt;br /&gt;
&lt;br /&gt;
In the upper right corner of the main window, new tickets will offer by default (depending on user rights) the Actions: Reply, Comment, Forward, Open It, Resolve, Reject, Delete, Take, and Extract Article. Reply and Comment will be covered shortly, in the [[ManualUsingWebInterface#Replying_and_commenting|Replying and Commenting]] section. Resolve means to close a ticket because work on it is finished, Open will change a ticket&#039;s status to &amp;quot;open&amp;quot;, Take makes you the ticket&#039;s owner, and Extract Article is part of RT&#039;s integration with the knowledgebase Articles.&lt;br /&gt;
&lt;br /&gt;
If anyone owns a ticket, the Take option disappears; likewise, once a ticket is resolved, the Resolve option disappears. If a resolved ticket is reopened with the Open It option, Open It disappears and Resolve reappears.&lt;br /&gt;
&lt;br /&gt;
The Display page sometimes has an Attachments portlet, which lists ticket attachments, organized by name and then by date.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
This panel on -- or separate view of -- the ticket shows everything that&#039;s ever happened to the ticket, including comments, replies, attachments and status and ownership changes.&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
[[File:Ticket-Basics.png|Ticket Basics Page|thumb|500px]]&lt;br /&gt;
&lt;br /&gt;
This is where you change the ticket&#039;s subject, status, queue, owner, time estimated, time worked, time left, priority, and final priority. A ticket&#039;s subject is what it sounds like; &amp;quot;time estimated&amp;quot;,&amp;quot;time worked&amp;quot; and &amp;quot;time left&amp;quot; refer to the (total) number of minutes worked on this ticket only. If you&#039;re unclear on status, queue, owner, or priority, refer to [[ManualIntroduction#RT_concepts|RT Concepts]].&lt;br /&gt;
&lt;br /&gt;
After changing information on the Basics page (or any other), don&#039;t forget to click the Save Changes button.&lt;br /&gt;
&lt;br /&gt;
This is also the page where you can change values in a custom field. Your organization may create its own fields, and they come up on a ticket&#039;s Basics page. They work like any other field: you type things in them or select things from them. To create your own custom fields, see [[ManualAdministration]].&lt;br /&gt;
&lt;br /&gt;
== Dates ==&lt;br /&gt;
&lt;br /&gt;
[[ManualTicketDates]]&lt;br /&gt;
&lt;br /&gt;
== People ==&lt;br /&gt;
&lt;br /&gt;
To reach a ticket&#039;s People screen from within a ticket, click People on top submenu or, alternatively, click on the porlet&#039;s tab.&lt;br /&gt;
&lt;br /&gt;
This page deals with a ticket&#039;s owner, requestor, Cc(s), Admin Cc(s) and optionally, Custom Roles. To review these roles, see [[ManualIntroduction#RT_concepts|RT Concepts]].&lt;br /&gt;
&lt;br /&gt;
There are two ways to add a watcher. If you know a potential watcher&#039;s email address, you can add one directly. Otherwise, you can search for them, then add whoever you&#039;ve found.&lt;br /&gt;
&lt;br /&gt;
To search for users before adding them as watchers:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
# look under &amp;quot;Find people whose&amp;quot;&lt;br /&gt;
# choose Username, Email, Name, or Organization from the first drop-down menu&lt;br /&gt;
# choose matches, doesn&#039;t match, is, or isn&#039;t from the second drop-down menu&lt;br /&gt;
# type your search term in the text box&lt;br /&gt;
# click the Go! button&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If RT finds a user, their username will appear in the Add new watchers area below. You&#039;ve now found your user, and you&#039;re ready to configure them as a watcher.&lt;br /&gt;
&lt;br /&gt;
To search for groups before adding them as watchers:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
# look under &amp;quot;Find group whose&amp;quot;&lt;br /&gt;
# choose Name or Description from the first drop-down menu&lt;br /&gt;
# choose matches, doesn&#039;t match, is, or isn&#039;t from the second drop-down menu&lt;br /&gt;
# type your search term in the text box&lt;br /&gt;
# click the Go! button&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If RT finds a group, the group name will appear in the Add new watchers area. You&#039;ve now found your group, and you&#039;re ready to configure it as a watcher.&lt;br /&gt;
&lt;br /&gt;
To add new watchers:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
# locate the Add new watchers section of the page&lt;br /&gt;
# for each watcher you&#039;re adding, choose Requestor, Cc, or [[AdminCC]] from the Type drop-down menu&lt;br /&gt;
# type the new watcher&#039;s email address in the Email text box, if it&#039;s not already filled in&lt;br /&gt;
# click the Save Changes button&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each email address, RT will search for an existing user to match it. If there is no match, RT will create a new unprivileged user.&lt;br /&gt;
&lt;br /&gt;
To remove a watcher:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
# locate the Current Watchers section of the page&lt;br /&gt;
# check the box next to the watcher(s) to delete&lt;br /&gt;
# click the Save Changes button&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To assign a ticket or change its owner:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
# change Owner drop-down menu to the person of your choice&lt;br /&gt;
# click the Save Changes button&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change a ticket&#039;s owner to yourself, click Take from within a ticket, this only works if the ticket was assigned to Nobody. Once a ticket is taken, the Take option disappears from the ticket&#039;s interface. If the ticket already has an owner, you can click &amp;quot;Steal&amp;quot; instead to own it. There is no intermediate &amp;quot;Are you sure you want to do this?&amp;quot; page, but if you wrongly take a ticket, you can always give it back.&lt;br /&gt;
&lt;br /&gt;
==Links ==&lt;br /&gt;
&lt;br /&gt;
Links in RT include Depends on, Depended on by, Parents, Children, Refers to, and Referred to by. If we just lost you, see [[ManualIntroduction#RT_concepts|RT Concepts]]. &lt;br /&gt;
&lt;br /&gt;
To reach a ticket&#039;s Links page, from within a ticket, click on the Links portlet tab or Links on the ticket submenu.&lt;br /&gt;
&lt;br /&gt;
You can add or delete links here, or merge duplicate tickets. In this screen shot, the links page for ticket #2, you&#039;ll see that ticket #2 is a child of parent ticket #3.&lt;br /&gt;
&lt;br /&gt;
[[File:Ticket-Links.png|Ticket Links Page|thumb|500px]]&lt;br /&gt;
&lt;br /&gt;
To merge two identical, duplicate tickets:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
# look under Merge&lt;br /&gt;
# enter only one ticket number in the Merge Into: text box&lt;br /&gt;
# click the Submit button&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If someone tries to use the ticket ID of a ticket you&#039;ve merged into another one, RT automatically redirects to the correct, newly-merged ticket.&lt;br /&gt;
&lt;br /&gt;
To add a link (Depends on, Depended on by, Parents, Children, Refers to, Referred to by):&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
# look under New Links&lt;br /&gt;
# enter ticket numbers (or other data) into the appropriate fields, separating multiple entries with spaces&lt;br /&gt;
# click the Submit button&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To delete a link:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
# look under Current Links&lt;br /&gt;
# check the box next to the link to delete&lt;br /&gt;
# click the Submit button&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add a link to an Article, see [[ManualUsingWebInterface#Replying_and_commenting|Replying and Commenting]].&lt;br /&gt;
&lt;br /&gt;
== Jumbo ==&lt;br /&gt;
&lt;br /&gt;
This page shows editable versions of the Basics, Dates, People, and Links (and Custom Fields if added) screens on one page, plus Update Ticket fields for adding comments or replies. This screen is useful if you must modify several aspects of a ticket at once. Be sure to click the Save Changes button when you&#039;re done.&lt;br /&gt;
&lt;br /&gt;
= Common tasks =&lt;br /&gt;
&lt;br /&gt;
Now that you know your way around RT&#039;s web interface, there are probably many tasks you can figure out on your own. However, we wanted to make sure you had a step-by-step guide to the most important and common tasks such as using RT&#039;s search functionality and working with tickets.&lt;br /&gt;
&lt;br /&gt;
== Searching for tickets ==&lt;br /&gt;
&lt;br /&gt;
[[ManualSearchTickets]]&lt;br /&gt;
&lt;br /&gt;
== Creating a new ticket ==&lt;br /&gt;
&lt;br /&gt;
To create a new ticket, start by selecting its queue:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
# from any page, select the queue of your choice from the &amp;quot;New ticket in&amp;quot; drop-down menu on the top right of the screen&lt;br /&gt;
# click the New Ticket in button&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
[[File:Ticket-Create.png|Ticket Create Page|thumb|500px]]&lt;br /&gt;
&lt;br /&gt;
The next page will be the Create a new ticket page, defaulting to the Show basics view with the following fields:&lt;br /&gt;
&lt;br /&gt;
* Queue: this should already be filled in for you.&lt;br /&gt;
* Status: generally, you&#039;ll leave this at the default, new. However, you might sometimes need to create a ticket to record a past occurrence or a problem that&#039;s already being worked on, so you might choose one of the other statuses from the drop-down menu.&lt;br /&gt;
* Owner: you can give the ticket an owner or leave this blank and let someone claim it later.&lt;br /&gt;
* You may also see some Custom Fields here if you created any and applied them to the queue&lt;br /&gt;
* Requestors: the default email address will be yours. Fill in any others if needed.&lt;br /&gt;
* Cc and Admin Cc: if you don&#039;t know what these are for, see [[ManualIntroduction#RT_concepts|RT Concepts]].&lt;br /&gt;
* You may also see some Custom Roles here if you created any and applied them to the queue&lt;br /&gt;
* Subject and Attach file should look familiar to most email users and work basically the same way.&lt;br /&gt;
* Describe the issue below means you should explain why this ticket exists.&lt;br /&gt;
&lt;br /&gt;
If you click Details from the top submenu, you&#039;ll be brought to the optional but potentially useful fields Priority, Final Priority, Time Estimated, Time Worked, Time Left, fields for dates (Starts and Due), and fields for each link (Depends on, Depended on by, Parents, Children, Refers to, Referred to by). These, too, are explained in [[ManualIntroduction#RT_concepts|RT Concepts]].&lt;br /&gt;
&lt;br /&gt;
When you&#039;re done filling in fields, click the Create button to make the ticket.&lt;br /&gt;
&lt;br /&gt;
== Replying and commenting ==&lt;br /&gt;
&lt;br /&gt;
There are two ways you can respond to a ticket. By default, a reply is public and a comment is hidden from the requestor. Comments and replies are listed permanently under the ticket&#039;s History.&lt;br /&gt;
&lt;br /&gt;
To say something about a ticket, first make sure you are within one of the ticket&#039;s pages (Display, History, Basics...) then click Comment or Reply in the Actions menu at the upper right of the page. To quote the text of an existing comment or reply inline, click Reply or Comment next to an existing reply/comment, from within the ticket&#039;s History (see screenshot).&lt;br /&gt;
&lt;br /&gt;
[[File:Ticket-Txn.png|Reply, Comment or Forward in Ticket History|thumb|500px]]&lt;br /&gt;
&lt;br /&gt;
On the resulting Ticket Update page, you&#039;ll see drop-down menus for Status and Owner. You probably won&#039;t need to change the defaults here.&lt;br /&gt;
&lt;br /&gt;
There will also be a text box for how many minutes the ticket has been worked on. Fill this in if you want to or if you are supposed to be logging your time.&lt;br /&gt;
&lt;br /&gt;
The Update Type drop-down menu will be automatically set to Comments (Not sent to requestors) or Response to requestors, depending on whether you clicked Comment or Reply as your first step. You can select the other option if you&#039;ve changed your mind. As a visual aid, the message box will be yellow for comments and red for replies.&lt;br /&gt;
&lt;br /&gt;
As for the other fields, we&#039;ll assume you have a working knowledge of email. RT correspondence has some fields that should be familiar to email users, such as Subject, CC, BCC, Attachments, and Message. The Subject field may be automatically filled in with the name of the ticket.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; email addresses in the CC and BCC fields of replies and comments will not automatically receive future updates.&lt;br /&gt;
&lt;br /&gt;
Enter your comment or reply in the Message field, and when everything&#039;s done, click the Submit button.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll be brought back to the ticket&#039;s Display page, with a status message on top that says your comment or reply has been sent/recorded, or that there is a problem and it hasn&#039;t.&lt;br /&gt;
&lt;br /&gt;
To add a signature that will appear by default at the bottom of all your comments and replies:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
# click Logged in as -&amp;gt; Settings -&amp;gt; About Me from the top navigation bar&lt;br /&gt;
# type your (preferably short) signature in the Signature field&lt;br /&gt;
# click the Save Preference&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reply and comment with Articles ===&lt;br /&gt;
&lt;br /&gt;
[[File:Ticket-Update-Articles.png|Add Articles to Reply/Comment|thumb|500px]]&lt;br /&gt;
&lt;br /&gt;
Articles is RT&#039;s knowledgebase system. If you are using Articles, you should know that when you reply to or comment on tickets in RT, you can search for and include (editable) Articles in the reply or comment. The ticket will now have a new link: Refers To (article of your choice). This screen shot shows the relevant part of the Reply or Comment screen, located above the Message box of the page:&lt;br /&gt;
&lt;br /&gt;
To find an Article to include in the reply or comment, enter a search term in the &amp;quot;Search for Articles matching&amp;quot; text box and click the Go button. Assuming there are search results, click the Go button next to the article you&#039;d like to include.&lt;br /&gt;
&lt;br /&gt;
If you know the name or id of the article you&#039;d like to include, enter it in the Include Article text box and click the Go button.&lt;br /&gt;
&lt;br /&gt;
== Modifying a ticket ==&lt;br /&gt;
&lt;br /&gt;
Listed alphabetically by item that could be changed:&lt;br /&gt;
&lt;br /&gt;
* dates:&lt;br /&gt;
:# click on the Dates portlet or menu item on ticket display&lt;br /&gt;
:# type the new date in the &amp;lt;code&amp;gt;Starts&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Due&amp;lt;/code&amp;gt; text box, &amp;lt;code&amp;gt;Started&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Last Contact&amp;lt;/code&amp;gt; can also be manually updated&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
* history: a ticket&#039;s history cannot be changed.&lt;br /&gt;
* owner:&lt;br /&gt;
:# from within a ticket&#039;s People page, change &amp;lt;code&amp;gt;Owner&amp;lt;/code&amp;gt; in drop-down menu to the person of your choice&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
* priorities:&lt;br /&gt;
:# from within a ticket&#039;s Basics page, type a new number in the &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;Final Priority&amp;lt;/code&amp;gt; fields&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
* queue:&lt;br /&gt;
:# from within a ticket&#039;s Basics page, select a new item from the &amp;lt;code&amp;gt;Queue&amp;lt;/code&amp;gt; drop-down menu&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
:# &#039;&#039;&#039;NOTE:&#039;&#039;&#039; that when you change a ticket&#039;s queue, queue-specific values such as custom fields will disappear. They will not be deleted, but they will be hidden.&lt;br /&gt;
* status:&lt;br /&gt;
:# from within a ticket&#039;s Basics page, select a value from the &amp;lt;code&amp;gt;Status&amp;lt;/code&amp;gt; drop-down menu&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
* subject:&lt;br /&gt;
:# from within a ticket&#039;s Basics page, type new data in the &amp;lt;code&amp;gt;Subject&amp;lt;/code&amp;gt; field&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
* time fields:&lt;br /&gt;
:# from within a ticket&#039;s Basics page, type a new number in the &amp;lt;code&amp;gt;Time Estimated&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;Time Worked&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;Time Left&amp;lt;/code&amp;gt; fields&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
&lt;br /&gt;
== Modifying people ==&lt;br /&gt;
&lt;br /&gt;
To assign a ticket or change its owner:&lt;br /&gt;
&lt;br /&gt;
:# from a ticket&#039;s People page, change Owner in drop-down menu to the person of your choice&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
&lt;br /&gt;
To add new watchers:&lt;br /&gt;
&lt;br /&gt;
:# from a ticket&#039;s People page, locate the &amp;quot;Add New Watchers&amp;quot; section of the page&lt;br /&gt;
:# choose Requestor, Cc, AdminCc or any Custom Role from the Type drop-down menu&lt;br /&gt;
:# type the new watcher&#039;s email address in the Email text box&lt;br /&gt;
:# add up to two more watchers, for a total of up to three&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
&lt;br /&gt;
To remove a watcher:&lt;br /&gt;
&lt;br /&gt;
:# from a ticket&#039;s People page, locate the Current Watchers section of the page&lt;br /&gt;
:# check the box next to the watcher(s) to delete&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
&lt;br /&gt;
== Modifying Links ==&lt;br /&gt;
&lt;br /&gt;
To add a link (Depends on, Depended on by, Parents, Children, Refers to, Referred to by):&lt;br /&gt;
&lt;br /&gt;
:# from within a ticket&#039;s Links page, look under New Links&lt;br /&gt;
:# enter ticket ids (or other data) into the appropriate fields, separating multiple entries with spaces&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
&lt;br /&gt;
To delete a link:&lt;br /&gt;
&lt;br /&gt;
:# from within a ticket&#039;s Links page, look under Current Links&lt;br /&gt;
:# check the box next to the link to delete&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
&lt;br /&gt;
To merge a duplicate ticket into an identical ticket:&lt;br /&gt;
&lt;br /&gt;
:# from within a ticket&#039;s Links page, look under Merge&lt;br /&gt;
:# enter only one ticket id in the Merge Into: text box&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
&lt;br /&gt;
If someone tries to use the ticket ID of a ticket you&#039;ve merged into another one, RT automatically redirects to the correct, newly-merged ticket. Merging tickets also merges all ticket data such as watchers, links, and history.&lt;br /&gt;
&lt;br /&gt;
== Updating many tickets at once ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, you may need to make a change to several tickets at once. There&#039;s an easy way to do this:&lt;br /&gt;
:# locate the tickets you want (see [[ManualUsingWebInterface#Searching_for_tickets|Searching for tickets]])&lt;br /&gt;
:# from the results page, click &amp;quot;Bulk Update&amp;quot; from the top submenu&lt;br /&gt;
:# you&#039;ll be sent to a Bulk ticket update page where you can add a comment or reply to all the tickets, or change the tickets&#039; owner, requestors, Cc, Admin Cc, subject, priority, queue, status, and various date fields. The power!&lt;br /&gt;
:# click the Update button&lt;br /&gt;
&lt;br /&gt;
== Resolving a ticket ==&lt;br /&gt;
&lt;br /&gt;
If a ticket has been completed and doesn&#039;t need any more work, you can resolve it by clicking Resolve in Actions menu of ticket&#039;s pages (Display, History, Basics...).&lt;br /&gt;
&lt;br /&gt;
This takes you to a comment form (see [[ManualUsingWebInterface#Replying_and_commenting|Replying and Commenting]]) but sets the Status drop-down menu to Resolved.&lt;br /&gt;
&lt;br /&gt;
You&#039;re encouraged to use the Message text box to explain why you&#039;re resolving the ticket.&lt;br /&gt;
&lt;br /&gt;
When you&#039;re done, click the Update Ticket button.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll be brought to the ticket&#039;s Display page and told the comment has been recorded and ticket has been resolved (or not, if there is a problem).&lt;br /&gt;
&lt;br /&gt;
== Changing your own user information ==&lt;br /&gt;
&lt;br /&gt;
[[File:About-Me.png|About Me Page|thumb|500px]]&lt;br /&gt;
&lt;br /&gt;
To change your own name, email address, phone numbers, location, signature or password:&lt;br /&gt;
&lt;br /&gt;
:# in the upper right of the screen, click Logged in as -&amp;gt; Settings -&amp;gt; About Me&lt;br /&gt;
:# type new information in the desired fields&lt;br /&gt;
:# click the Save Preferences button&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You&#039;ll need the right &amp;quot;ModifySelf&amp;quot; to view this page and make changes.&lt;br /&gt;
&lt;br /&gt;
== Groups ==&lt;br /&gt;
&lt;br /&gt;
Users can grant their rights to others by creating a group and delegating the rights to the members of that group. This is convenient if you&#039;re going on vacation or need to pass the buck for any reason.&lt;br /&gt;
&lt;br /&gt;
To view existing groups, go to Admin -&amp;gt; Groups -&amp;gt; Select -&amp;gt; [select group name]&lt;br /&gt;
&lt;br /&gt;
To make a new group:&lt;br /&gt;
&lt;br /&gt;
:# go to Admin -&amp;gt; Groups -&amp;gt; Create&lt;br /&gt;
:# type your group&#039;s name and description in the &amp;lt;code&amp;gt;Name:&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Description:&amp;lt;/code&amp;gt; text boxes&lt;br /&gt;
:# click the Create button&lt;br /&gt;
&lt;br /&gt;
To add members to a group:&lt;br /&gt;
&lt;br /&gt;
:# click the name of a group&lt;br /&gt;
:# click Members from the top submenu&lt;br /&gt;
:# select user(s) or group(s) from the Add members are&lt;br /&gt;
:# click the Modify Members button&lt;br /&gt;
&lt;br /&gt;
To delete members from a group:&lt;br /&gt;
&lt;br /&gt;
:# click the name of a group&lt;br /&gt;
:# click Members from the top submenu&lt;br /&gt;
:# check the box next to the user(s) or group(s) to delete&lt;br /&gt;
:# click the Modify Members button&lt;br /&gt;
&lt;br /&gt;
To change a group&#039;s name or description:&lt;br /&gt;
&lt;br /&gt;
:# click the name of a group&lt;br /&gt;
:# make changes&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
&lt;br /&gt;
To disable a personal group:&lt;br /&gt;
&lt;br /&gt;
:# click the name of a group&lt;br /&gt;
:# clear the Enabled checkbox&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
&lt;br /&gt;
Unlike disabled users and queues, disabled groups will still be visible in listings. That removes a step from the process of re-enabling them when necessary.&lt;br /&gt;
&lt;br /&gt;
To re-enable a group:&lt;br /&gt;
&lt;br /&gt;
:# click the name of a group&lt;br /&gt;
:# check the Enabled checkbox&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
&lt;br /&gt;
== Rights ==&lt;br /&gt;
[[File:Group-Rights.png|Group Rights Page|thumb|500px]]&lt;br /&gt;
&lt;br /&gt;
Once you have a group, you can grant rights.&lt;br /&gt;
&lt;br /&gt;
* In order to delegate rights, you&#039;ll need to have the right &amp;quot;ShowConfigTab&amp;quot;, which allows you to view the Admin menu in the top navigation bar &lt;br /&gt;
* If you&#039;ve been granted a right globally, you can&#039;t delegate it for just one queue and vice versa.&lt;br /&gt;
&lt;br /&gt;
To grant rights to a group:&lt;br /&gt;
&lt;br /&gt;
:# go to Admin -&amp;gt; Global -&amp;gt; Group Rights&lt;br /&gt;
:# on the left side of the page, select a system group, role, or user group listed, or search for a group under &amp;quot;Add Group&amp;quot;&lt;br /&gt;
:# rights are grouped by &amp;quot;General Rights&amp;quot;, &amp;quot;Rights for Staff&amp;quot; and &amp;quot;Rights for Administrators&amp;quot;, these are suggested rights, but you may grant whichever from any of the tabs&lt;br /&gt;
:# check the box(es) next to the right(s) you&#039;d like to grant&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
&lt;br /&gt;
To revoke rights on a group:&lt;br /&gt;
&lt;br /&gt;
:# go to Admin -&amp;gt; Global -&amp;gt; Group Rights&lt;br /&gt;
:# on the left side of the page, select a system group, role, or user group listed, or search for a group under &amp;quot;Add Group&amp;quot;&lt;br /&gt;
:# uncheck the box(es) next to the right(s) you&#039;d like to revoke&lt;br /&gt;
:# click the Save Changes button&lt;br /&gt;
&lt;br /&gt;
== Logging out ==&lt;br /&gt;
&lt;br /&gt;
You can leave yourself logged into RT without breaking anything, but logging out is a good habit to get into for security purposes. Logging out is standard:&lt;br /&gt;
&lt;br /&gt;
* click Logged in as -&amp;gt; Logout in the top navigation bar&lt;br /&gt;
&lt;br /&gt;
Some RT configurations don&#039;t have a Logout button, so don&#039;t panic if you don&#039;t see one.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Prev: [[ManualBasicAdministration]] --- Up: [[UserManual]] --- Next: [[ManualAdministration]]&lt;br /&gt;
[[Category:RT User Manual]]&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Ticket&amp;diff=26874</id>
		<title>Ticket</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Ticket&amp;diff=26874"/>
		<updated>2019-03-28T20:28:33Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;Ticket&#039;&#039;&#039; (or &#039;&#039;&#039;Request&#039;&#039;&#039;) is a collection of information concerning some subject to be tracked.&lt;br /&gt;
&lt;br /&gt;
RT keeps track of everything that happens to a ticket, including internal discussions and discussions with the originator.&lt;br /&gt;
&lt;br /&gt;
A ticket has the following:&lt;br /&gt;
&lt;br /&gt;
* A [[Requestor]] - the [[User]] that is waiting for the issue to be resolved. In some cases there may be no requestor on a ticket or more than one.&lt;br /&gt;
&lt;br /&gt;
* An [[Owner]] - the [[User]] that is currently responsible for resolving the issue.&lt;br /&gt;
&lt;br /&gt;
* Zero or more [[CC]]s who are treated like co-requestors.&lt;br /&gt;
&lt;br /&gt;
* Zero or more [[AdminCC]]s who are treated like co-owners.&lt;br /&gt;
&lt;br /&gt;
* A Status which tracks where the ticket is in the current workflow. Status and workflow can be customized using RT&#039;s [https://docs.bestpractical.com/rt/latest/customizing/lifecycles.html Lifecycle] feature.&lt;br /&gt;
&lt;br /&gt;
* A ticket belongs to a [[Queue]]. A Queue can be used to hold a certain &amp;quot;class&amp;quot; of tickets, e.g. those that should be handled by a particular group of Users.&lt;br /&gt;
&lt;br /&gt;
* A [[Priority]]&lt;br /&gt;
&lt;br /&gt;
* A [[DueDate]], the date it was Created, the LastUpdated date, and the date it was Resolved, if it is complete.&lt;br /&gt;
&lt;br /&gt;
* A record of how much time has been spent on a ticket.&lt;br /&gt;
&lt;br /&gt;
* [[Relationships]] to other tickets as links.&lt;br /&gt;
&lt;br /&gt;
[[Category:RT44]]&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Demo&amp;diff=26873</id>
		<title>Demo</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Demo&amp;diff=26873"/>
		<updated>2019-03-28T20:26:21Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you want to try RT, you can find demonstration sites here:&lt;br /&gt;
&lt;br /&gt;
* http://rt.easter-eggs.org/demos/&lt;br /&gt;
* https://demo.bestpractical.com/&lt;br /&gt;
&lt;br /&gt;
[[Category:RT44]]&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Category:RT44&amp;diff=26872</id>
		<title>Category:RT44</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Category:RT44&amp;diff=26872"/>
		<updated>2019-03-28T20:24:23Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: Created page with &amp;quot;The RT44 category contains pages that have been updated after the release of RT 4.4. These categories provide a way to assess how current a page is.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The RT44 category contains pages that have been updated after the release of RT 4.4. These categories provide a way to assess how current a page is.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=UserManual&amp;diff=26871</id>
		<title>UserManual</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=UserManual&amp;diff=26871"/>
		<updated>2019-03-28T20:22:41Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
* [[ManualIntroduction]]&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
* [[ManualRequirements]]&lt;br /&gt;
* [[ManualInstallation]]&lt;br /&gt;
&lt;br /&gt;
= Initial configuration and basic administration =&lt;br /&gt;
&lt;br /&gt;
* [[ManualApacheConfig]]&lt;br /&gt;
* [[ManualEmailConfig]]&lt;br /&gt;
* [[ManualBasicAdministration]]&lt;br /&gt;
&lt;br /&gt;
= Using web interface and RT in general =&lt;br /&gt;
&lt;br /&gt;
* [[ManualUsingWebInterface]] and its subchapters:&lt;br /&gt;
:* [[ManualTicketDates]]&lt;br /&gt;
:* [[ManualDashboards]]&lt;br /&gt;
:* [[ManualSearchTickets]]&lt;br /&gt;
:** [[ManualSimpleSearch]]&lt;br /&gt;
&lt;br /&gt;
= Advanced administration =&lt;br /&gt;
&lt;br /&gt;
* [[ManualAdministration]]&lt;br /&gt;
* [[ManualProblems]]&lt;br /&gt;
&lt;br /&gt;
= Appendices =&lt;br /&gt;
&lt;br /&gt;
* [[ManualRights]]&lt;br /&gt;
* [[ManualScrips]]&lt;br /&gt;
* [[ManualApache]]&lt;br /&gt;
* [[ManualApprovals]]&lt;br /&gt;
&lt;br /&gt;
= Glossary =&lt;br /&gt;
&lt;br /&gt;
* [[RTGlossary]]&lt;br /&gt;
&lt;br /&gt;
= History of this manual =&lt;br /&gt;
&lt;br /&gt;
In April 2003, [[BestPractical]] released a draft user manual for RT as a downloadable PDF. That manual became a starting point for this part of the wiki to be updated and extended by the community. Documentation for [https://docs.bestpractical.com/rt/latest RT] and [https://docs.bestpractical.com/rtir/latest RTIR] is also available on the [https://bestpractical.com/docs Best Practical] website.&lt;br /&gt;
&lt;br /&gt;
[[Category:RT User Manual]]&lt;br /&gt;
[[Category:RT44]]&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=UpdateTheWiki&amp;diff=26870</id>
		<title>UpdateTheWiki</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=UpdateTheWiki&amp;diff=26870"/>
		<updated>2019-03-28T20:18:55Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Updating the wiki is very easy.&lt;br /&gt;
&lt;br /&gt;
== To edit existing pages ==&lt;br /&gt;
&lt;br /&gt;
* Click the Edit link at the top of the page or on any section.&lt;br /&gt;
* Edit the page contents and click save.&lt;br /&gt;
* If presented with a simple question about RT, answer it. This helps us keep the wiki spam to a minimum.&lt;br /&gt;
&lt;br /&gt;
== To add new pages ==&lt;br /&gt;
&lt;br /&gt;
* Click the edit link on the page where you want to add the first link to the new page.&lt;br /&gt;
* Add [[CamelCaseNameOfNewPage]] to the text of the page and click save. ([http://en.wikipedia.org/wiki/CamelCase What&#039;s CamelCase?]).&lt;br /&gt;
* You should see [[CamelCaseNameOfNewPage]] as a red link.&lt;br /&gt;
* Click this link and you will see a create box for the new page.&lt;br /&gt;
&lt;br /&gt;
If name of the new page doesn&#039;t match [[CamelCase]] notation, like REST or Ticket use [[REST]] or [[Ticket]].&lt;br /&gt;
&lt;br /&gt;
You can use the following trick as well:&lt;br /&gt;
&lt;br /&gt;
* In the URL string of your browser write https://rt-wiki.bestpractical.com/wiki/NameOfNewPage&lt;br /&gt;
* Hit enter and you&#039;ll seeing a page that already exists or a page that gives you the option to create a new page. Click the links to do that.&lt;br /&gt;
* This trick has a trade-off, as a new page is not linked to from any other page. People can only find it with the search box, so you have to add links later.&lt;br /&gt;
&lt;br /&gt;
Additional information:&lt;br /&gt;
&lt;br /&gt;
* [[WikiWishList]] - wish list for the RT Wiki&lt;br /&gt;
* [[LowHangingFruit]] - improvements to wiki formatting which do not require extensive knowledge of RT.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Main_Page&amp;diff=26869</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Main_Page&amp;diff=26869"/>
		<updated>2019-03-28T20:01:19Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== RT ==&lt;br /&gt;
&lt;br /&gt;
RT is an open source issue tracking and workflow platform developed and supported by [https://bestpractical.com Best Practical Solutions]. This wiki site is a free resource for the RT community to share ideas, configurations, and customizations to RT, RTIR, and related products.&lt;br /&gt;
&lt;br /&gt;
Please: [[UpdateTheWiki]], post your hints, tricks, tips and tools about how to get the most out of RT. If you currently use RT, please head over to [[RTUsers]] and add yourself and your organization to the user list.&lt;br /&gt;
&lt;br /&gt;
== About RT Documentation ==&lt;br /&gt;
&lt;br /&gt;
In addition to the information found here, you can find RT&#039;s documentation in your install of RT on the server and also [https://bestpractical.com/resources/ on the web at the Best Practical website]. The [https://bestpractical.com/blog Best Practical blog] and the [https://forum.bestpractical.com Community Forum] are also great resources for RT information. Best Practical also offers commercial support services to help get the most out of RT and RTIR.&lt;br /&gt;
&lt;br /&gt;
== Getting Started with RT ==&lt;br /&gt;
&lt;br /&gt;
If you&#039;re new to RT, start with the [[UserManual]].&lt;br /&gt;
&lt;br /&gt;
== Current Sections ==&lt;br /&gt;
&lt;br /&gt;
You can go through these pretty much in order if you&#039;re starting from scratch, but please plan to spend some quality time with the [[UserManual]] before you try to go live; RT is big and full of tons of features, and you probably can&#039;t get your head around all of it in one sitting.&lt;br /&gt;
&lt;br /&gt;
* [[Demo]]&lt;br /&gt;
&lt;br /&gt;
== Historical Sections ==&lt;br /&gt;
&lt;br /&gt;
RT has been in development for over 20 years, so information on this wiki dates back to many different versions. These sections may contain information on older versions of RT that is no longer completely accurate for modern RT. Pages known to be updated should be moved up to the Current Section.&lt;br /&gt;
&lt;br /&gt;
* [[FAQ]], [[FindingAnswersAboutRT]] and &amp;quot;Common Problems&amp;quot; below.&lt;br /&gt;
* [[BugReporting]]&lt;br /&gt;
* [[HowToHelp]], [[Translation]]&lt;br /&gt;
&lt;br /&gt;
* [[RTGlossary]] &amp;amp;amp; [[Documentation]]&lt;br /&gt;
* [[InstallationGuides]], [[RTTutorials]]&lt;br /&gt;
* [[RT Config|RT_Config]] &amp;amp;amp; [[RT SiteConfig|RT_SiteConfig]]&lt;br /&gt;
&lt;br /&gt;
* [[Extensions]] to RT available as installable plugins&lt;br /&gt;
* [[Contributions]] by the community to customize RT&lt;br /&gt;
* [[RTIR]] RT for Incident Response&lt;br /&gt;
* [[RTFM]] RT FAQ Manager&lt;br /&gt;
&lt;br /&gt;
* [[RTHistory]]&lt;br /&gt;
* [[InThePress]]&lt;br /&gt;
* [[REST]] API&lt;br /&gt;
* Customizing with [[CustomizingWithCallbacks|Callbacks]]&lt;br /&gt;
&lt;br /&gt;
=== Common problems ===&lt;br /&gt;
&lt;br /&gt;
* [[CantLocateObject]] - Can&#039;t locate object method &amp;quot;new&amp;quot; via package &amp;quot;&amp;lt;code&amp;gt;RT::Handle&amp;lt;/code&amp;gt;&amp;quot; at rt3/lib/RT.pm&lt;br /&gt;
* [[NoConnectionToSyslog]] - no connection to syslog&lt;br /&gt;
* [[NoRecipFound]] - No recipients found. Not sending&lt;br /&gt;
* Getting information out of RT3 for [[reporting]] or inclusion elsewhere.&lt;br /&gt;
* [[PermissionDenied]] emails|&lt;br /&gt;
* Getting RT4.x to play nice with [[certbot]] to obtain free SSL certificates from [http://letsencrypt.org LetsEncrypt].&lt;br /&gt;
&lt;br /&gt;
== Wish lists ==&lt;br /&gt;
&lt;br /&gt;
* [[WikiWishList]] - wish list for this wiki&lt;br /&gt;
* [[WishList]] - wish list for the RT&lt;br /&gt;
* [[RT3StatisticsPackageWishList]]&lt;br /&gt;
&lt;br /&gt;
== Getting started with MediaWiki ==&lt;br /&gt;
&lt;br /&gt;
To learn more about how to edit wiki pages, click the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Help] link here or in the navigation on the left.&lt;br /&gt;
&lt;br /&gt;
We have installed the Markdown plugin, so you can edit pages in Markdown.&lt;br /&gt;
&lt;br /&gt;
Several years ago, we moved the wiki from Wikia as noted on the [[Wikia Move]] page.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Demo&amp;diff=26868</id>
		<title>Demo</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Demo&amp;diff=26868"/>
		<updated>2019-03-28T20:00:43Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you want to try RT, you can find demonstration sites here:&lt;br /&gt;
&lt;br /&gt;
* http://rt.easter-eggs.org/demos/&lt;br /&gt;
* https://demo.bestpractical.com/&lt;br /&gt;
&lt;br /&gt;
[[Category:New category]]&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=UpdateTheWiki&amp;diff=26867</id>
		<title>UpdateTheWiki</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=UpdateTheWiki&amp;diff=26867"/>
		<updated>2019-03-28T19:56:07Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Updating the wiki is very easy.&lt;br /&gt;
&lt;br /&gt;
== To edit existing pages ==&lt;br /&gt;
&lt;br /&gt;
* Click the Edit link at the top of the page or on any section.&lt;br /&gt;
* Edit the page contents and click save.&lt;br /&gt;
* If presented with a simple question about RT, answer it. This helps us keep the wiki spam to a minimum.&lt;br /&gt;
&lt;br /&gt;
== To add new pages ==&lt;br /&gt;
&lt;br /&gt;
* Click the edit link on the page where you want to add the first link to the new page.&lt;br /&gt;
* Add [[CamelCaseNameOfNewPage]] to the text of the page and click save. ([http://en.wikipedia.org/wiki/CamelCase What&#039;s CamelCase?]).&lt;br /&gt;
* You should see [[CamelCaseNameOfNewPage]] as a red link.&lt;br /&gt;
* Click this link and you will see a create box for the new page.&lt;br /&gt;
&lt;br /&gt;
If name of the new page doesn&#039;t match [[CamelCase]] notation, like REST or Ticket use [[REST]] or [[Ticket]].&lt;br /&gt;
&lt;br /&gt;
You can use the following trick as well:&lt;br /&gt;
&lt;br /&gt;
* In the URL string of your browser write https://rt-wiki.bestpractical.com/index.php?title=NameOfNewPage&lt;br /&gt;
* Hit enter and you&#039;ll seeing a page that already exists or a page that gives you the option to create a new page. Click the links to do that.&lt;br /&gt;
* This trick has a trade-off, as a new page is not linked to from any other page. People can only find it with the search box, so you have to add links later.&lt;br /&gt;
&lt;br /&gt;
Additional information:&lt;br /&gt;
&lt;br /&gt;
* [[WikiWishList]] - wish list for the RT Wiki&lt;br /&gt;
* [[LowHangingFruit]] - improvements to wiki formatting which do not require extensive knowledge of RT.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Main_Page&amp;diff=26866</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Main_Page&amp;diff=26866"/>
		<updated>2019-03-28T19:51:22Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== RT ==&lt;br /&gt;
&lt;br /&gt;
RT is an open source issue tracking and workflow platform developed and supported by [https://bestpractical.com Best Practical Solutions]. This wiki site is a free resource for the RT community to share ideas, configurations, and customizations to RT, RTIR, and related products.&lt;br /&gt;
&lt;br /&gt;
Please: [[UpdateTheWiki]], post your hints, tricks, tips and tools about how to get the most out of RT. If you currently use RT, please head over to [[RTUsers]] and add yourself and your organization to the user list.&lt;br /&gt;
&lt;br /&gt;
== About RT Documentation ==&lt;br /&gt;
&lt;br /&gt;
In addition to the information found here, you can find RT&#039;s documentation in your install of RT on the server and also [https://bestpractical.com/resources/ on the web at the Best Practical website]. The [https://bestpractical.com/blog Best Practical blog] and the [https://forum.bestpractical.com Community Forum] are also great resources for RT information. Best Practical also offers commercial support services to help get the most out of RT and RTIR.&lt;br /&gt;
&lt;br /&gt;
== Getting Started with RT ==&lt;br /&gt;
&lt;br /&gt;
If you&#039;re new to RT, start with the [[UserManual]].&lt;br /&gt;
&lt;br /&gt;
== Current Sections ==&lt;br /&gt;
&lt;br /&gt;
You can go through these pretty much in order if you&#039;re starting from scratch, but please plan to spend some quality time with the [[UserManual]] before you try to go live; RT is big and full of tons of features, and you probably can&#039;t get your head around all of it in one sitting.&lt;br /&gt;
&lt;br /&gt;
== Historical Sections ==&lt;br /&gt;
&lt;br /&gt;
RT has been in development for over 20 years, so information on this wiki dates back to many different versions. These sections may contain information on older versions of RT that is no longer completely accurate for modern RT. Pages known to be updated should be moved up to the Current Section.&lt;br /&gt;
&lt;br /&gt;
* [[FAQ]], [[FindingAnswersAboutRT]] and &amp;quot;Common Problems&amp;quot; below.&lt;br /&gt;
* [[BugReporting]]&lt;br /&gt;
* [[HowToHelp]], [[Translation]]&lt;br /&gt;
* [[Demo]]&lt;br /&gt;
* [[RTGlossary]] &amp;amp;amp; [[Documentation]]&lt;br /&gt;
* [[InstallationGuides]], [[RTTutorials]]&lt;br /&gt;
* [[RT Config|RT_Config]] &amp;amp;amp; [[RT SiteConfig|RT_SiteConfig]]&lt;br /&gt;
&lt;br /&gt;
* [[Extensions]] to RT available as installable plugins&lt;br /&gt;
* [[Contributions]] by the community to customize RT&lt;br /&gt;
* [[RTIR]] RT for Incident Response&lt;br /&gt;
* [[RTFM]] RT FAQ Manager&lt;br /&gt;
&lt;br /&gt;
* [[RTHistory]]&lt;br /&gt;
* [[InThePress]]&lt;br /&gt;
* [[REST]] API&lt;br /&gt;
* Customizing with [[CustomizingWithCallbacks|Callbacks]]&lt;br /&gt;
&lt;br /&gt;
=== Common problems ===&lt;br /&gt;
&lt;br /&gt;
* [[CantLocateObject]] - Can&#039;t locate object method &amp;quot;new&amp;quot; via package &amp;quot;&amp;lt;code&amp;gt;RT::Handle&amp;lt;/code&amp;gt;&amp;quot; at rt3/lib/RT.pm&lt;br /&gt;
* [[NoConnectionToSyslog]] - no connection to syslog&lt;br /&gt;
* [[NoRecipFound]] - No recipients found. Not sending&lt;br /&gt;
* Getting information out of RT3 for [[reporting]] or inclusion elsewhere.&lt;br /&gt;
* [[PermissionDenied]] emails|&lt;br /&gt;
* Getting RT4.x to play nice with [[certbot]] to obtain free SSL certificates from [http://letsencrypt.org LetsEncrypt].&lt;br /&gt;
&lt;br /&gt;
== Wish lists ==&lt;br /&gt;
&lt;br /&gt;
* [[WikiWishList]] - wish list for this wiki&lt;br /&gt;
* [[WishList]] - wish list for the RT&lt;br /&gt;
* [[RT3StatisticsPackageWishList]]&lt;br /&gt;
&lt;br /&gt;
== Getting started with MediaWiki ==&lt;br /&gt;
&lt;br /&gt;
To learn more about how to edit wiki pages, click the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Help] link here or in the navigation on the left.&lt;br /&gt;
&lt;br /&gt;
We have installed the Markdown plugin, so you can edit pages in Markdown.&lt;br /&gt;
&lt;br /&gt;
Several years ago, we moved the wiki from Wikia as noted on the [[Wikia Move]] page.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=UserManual&amp;diff=26862</id>
		<title>UserManual</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=UserManual&amp;diff=26862"/>
		<updated>2019-03-22T14:35:53Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
* [[ManualIntroduction]]&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
* [[ManualRequirements]]&lt;br /&gt;
* [[ManualInstallation]]&lt;br /&gt;
&lt;br /&gt;
= Initial configuration and basic administration =&lt;br /&gt;
&lt;br /&gt;
* [[ManualApacheConfig]]&lt;br /&gt;
* [[ManualEmailConfig]]&lt;br /&gt;
* [[ManualBasicAdministration]]&lt;br /&gt;
&lt;br /&gt;
= Using web interface and RT in general =&lt;br /&gt;
&lt;br /&gt;
* [[ManualUsingWebInterface]] and its subchapters:&lt;br /&gt;
:* [[ManualTicketDates]]&lt;br /&gt;
:* [[ManualDashboards]]&lt;br /&gt;
:* [[ManualSearchTickets]]&lt;br /&gt;
:** [[ManualSimpleSearch]]&lt;br /&gt;
&lt;br /&gt;
= Advanced administration =&lt;br /&gt;
&lt;br /&gt;
* [[ManualAdministration]]&lt;br /&gt;
* [[ManualProblems]]&lt;br /&gt;
&lt;br /&gt;
= Appendices =&lt;br /&gt;
&lt;br /&gt;
* [[ManualRights]]&lt;br /&gt;
* [[ManualScrips]]&lt;br /&gt;
* [[ManualApache]]&lt;br /&gt;
* [[ManualApprovals]]&lt;br /&gt;
&lt;br /&gt;
= Glossary =&lt;br /&gt;
&lt;br /&gt;
* [[RTGlossary]]&lt;br /&gt;
&lt;br /&gt;
= History of this manual =&lt;br /&gt;
&lt;br /&gt;
In April 2003, [[BestPractical]] released a draft user manual for RT as a downloadable PDF. That manual became a starting point for this part of the wiki to be updated and extended by the community. Documentation for [https://docs.bestpractical.com/rt/latest RT] and [https://docs.bestpractical.com/rtir/latest RTIR] is also available on the [https://bestpractical.com/docs Best Practical] website.&lt;br /&gt;
&lt;br /&gt;
[[Category:RT User Manual]]&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=BestPractical&amp;diff=26830</id>
		<title>BestPractical</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=BestPractical&amp;diff=26830"/>
		<updated>2019-03-21T12:32:44Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://bestpractical.com/ Best Practical Solutions LLC] are the creators of [https://bestpractical.com/request-tracker/ Request Tracker], [https://bestpractical.com/rtir Request Tracker for Incident Response] and other products. We also provide commercial support, custom development, hosting, and install and upgrade services for RT and RTIR.&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=UserManual&amp;diff=26801</id>
		<title>UserManual</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=UserManual&amp;diff=26801"/>
		<updated>2019-03-20T15:37:56Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= About this manual =&lt;br /&gt;
&lt;br /&gt;
In April 2003, [[BestPractical]] released a draft user manual for RT as a downloadable PDF. That manual is now part of this wiki to be updated and extended by the community.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
* [[ManualIntroduction]]&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
* [[ManualRequirements]]&lt;br /&gt;
* [[ManualInstallation]]&lt;br /&gt;
&lt;br /&gt;
= Initial configuration and basic administration =&lt;br /&gt;
&lt;br /&gt;
* [[ManualApacheConfig]]&lt;br /&gt;
* [[ManualEmailConfig]]&lt;br /&gt;
* [[ManualBasicAdministration]]&lt;br /&gt;
&lt;br /&gt;
= Using web interface and RT in general =&lt;br /&gt;
&lt;br /&gt;
* [[ManualUsingWebInterface]] and its subchapters:&lt;br /&gt;
** [[ManualTicketDates]]&lt;br /&gt;
** [[ManualDashboards]]&lt;br /&gt;
** [[ManualSearchTickets]]&lt;br /&gt;
*** [[ManualSimpleSearch]]&lt;br /&gt;
&lt;br /&gt;
= Advanced administration =&lt;br /&gt;
&lt;br /&gt;
* [[ManualAdministration]]&lt;br /&gt;
* [[ManualProblems]]&lt;br /&gt;
&lt;br /&gt;
= Appendices =&lt;br /&gt;
&lt;br /&gt;
* [[ManualRights]]&lt;br /&gt;
* [[ManualScrips]]&lt;br /&gt;
* [[ManualApache]]&lt;br /&gt;
* [[ManualApprovals]]&lt;br /&gt;
&lt;br /&gt;
= Glossary =&lt;br /&gt;
&lt;br /&gt;
* [[RTGlossary]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:RT User Manual]]&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualIntroduction&amp;diff=26800</id>
		<title>ManualIntroduction</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualIntroduction&amp;diff=26800"/>
		<updated>2019-03-20T15:35:34Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Up: [[UserManual]] --- Next: [[ManualRequirements]]&lt;br /&gt;
&lt;br /&gt;
Welcome to Request Tracker (RT), your new favorite ticketing system. This introduction explains what ticketing is and what RT is. If you&#039;re already familiar with RT, you can skip ahead.&lt;br /&gt;
&lt;br /&gt;
= About Ticketing =&lt;br /&gt;
&lt;br /&gt;
In some contexts, when people think about a &amp;quot;ticket,&amp;quot; they&#039;re talking about a code on their phone or a physical piece of paper that gets them into an event or on an airplane for a flight. The RT type of ticketing is a way for organizations to keep track of their to-do lists, who is working on which tasks, what&#039;s already been done, and when tasks were completed. You will also hear the phrase &amp;quot;trouble ticketing&amp;quot; bandied about, though there does not have to be a problem for ticketing to be useful. &amp;quot;Issue tracking&amp;quot; is another common phrase used for general ticketing.&lt;br /&gt;
&lt;br /&gt;
Ticketing can make life easier for many people and departments in an organization -- basically anyone who needs to keep track of a list of tasks. And it can be used with a variety of tasks, like fixing software bugs, answering customer service requests, or tracking security issues.&lt;br /&gt;
&lt;br /&gt;
Tickets can be a simple record of work done, like &amp;quot;Applied software patches on server,&amp;quot; or detailed records with many custom fields and a long history. How you use tickets in RT will depend on your use case and can differ from queue to queue. Whatever your approach, it&#039;s good to communicate with users so everyone understands why and how they should interact with the system.&lt;br /&gt;
&lt;br /&gt;
= About RT =&lt;br /&gt;
&lt;br /&gt;
RT is a ticketing system for all sizes of organizations. It is available under the terms of the GNU General Public License (GPL), so it doesn&#039;t cost anything to set up and use. Managed hosting plans and commercial support are also available from [https://bestpractical.com Best Practical Solutions]. We&#039;ll get into the technical features later, but for now, let&#039;s look at how RT might work:&lt;br /&gt;
&lt;br /&gt;
* Billy has a problem with his Bananamaster 3000, so he sends email to help@example.com&lt;br /&gt;
* RT records the new issue in its database and sends Billy an electronic &amp;quot;ticket stub&amp;quot; containing the new ticket&#039;s ID number and, ideally, some helpful information. He can refer to the ticket stub if he needs to send another email later.&lt;br /&gt;
* RT forwards Billy&#039;s email to a set of staff members.&lt;br /&gt;
* One of the staff members, Jane, is the company&#039;s Bananamaster expert. So Jane takes over Billy&#039;s issue and drafts a reply to Billy, which RT automatically records and forwards to him.&lt;br /&gt;
* Billy is a happy customer; Jane resolves the issue and heads down to the pub for a pint.&lt;br /&gt;
&lt;br /&gt;
This workflow is flexible, can be customized for your organization, and need not involve bananas.&lt;br /&gt;
&lt;br /&gt;
= RT concepts =&lt;br /&gt;
&lt;br /&gt;
There are some words and phrases you should understand in the context of RT before you begin. See [[RTGlossary]] for more definitions.&lt;br /&gt;
&lt;br /&gt;
A [[Ticket]] is the central object in RT, the thing that needs to get done. Tickets have metadata attached to them such as an owner, status, and queue - we&#039;ll get to all that in a minute.&lt;br /&gt;
&lt;br /&gt;
A [[Queue]] is the central administrative domain of RT; it keeps things organized. As the name implies, it&#039;s a line of tickets waiting to be worked on, but it&#039;s also, to some extent, the ticket&#039;s category. For instance, you might have the right to create, delete, and comment on tickets in the Foo queue, but only the right to comment on tickets in the Bar queue.&lt;br /&gt;
&lt;br /&gt;
A ticket&#039;s history is what it sounds like: everything that&#039;s happened to a ticket. Facets of ticket history could include when the ticket was created, how it has changed, and any comments about it or replies to it. Like real history, ticket history typically is not changed. However, new laws related to user privacy like [https://docs.bestpractical.com/rt/latest/GDPR.html GDPR] in the EU require some organizations to evaluate their auditing policies and decide how to handle requests to remove personal user data. This can require ticket data to be modified or removed completely.&lt;br /&gt;
&lt;br /&gt;
Ticket updates can take one of two forms. A reply is a public remark that a requestor can see. A comment is a private note for staff not visible to the requestor. This is useful when you want to be tactful but still convey important information, like, &amp;quot;This requestor is an investor, so be nice&amp;quot; or &amp;quot;This user&#039;s request mentioned his &#039;PC&#039; but he really has a Mac.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Priority, how important a ticket is, is represented as numerical scale from 0-99, with 99 being the highest priority. By setting a final priority, you can make a ticket&#039;s priority increase or decrease as its due date draws closer. The difference between 20, 50, and 75 may vary from organization to organization, but there should be an organizational policy or every ticket will get rated 99 by anxious users. [[ManualAdministration]] contains a useful model for setting organizational policy for priority. You can also install the [https://metacpan.org/pod/RT::Extension::PriorityAsString PriorityAsString] extension to manage priority with terms like &amp;quot;high&amp;quot; and &amp;quot;low&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The status drop-down menu offers several choices for classifying each ticket. Here&#039;s what they mean:&lt;br /&gt;
&lt;br /&gt;
* new: the ticket has just been created and hasn&#039;t been touched yet.&lt;br /&gt;
* open: the ticket is getting worked on&lt;br /&gt;
* stalled: due to circumstances beyond your control (waiting for the requestor to respond, waiting for the owner to return from Sri Lanka), the ticket isn&#039;t getting worked on right now. It will open again when someone adds a comment or reply.&lt;br /&gt;
* resolved: hooray! Work on the ticket has been completed and is out of everyone&#039;s hair.&lt;br /&gt;
* rejected: the ticket is not the staff&#039;s problem and is not going to be resolved, but is, for some reason, worth recording in the system. For instance, if an employee asks approval for something ridiculous, you can reject the ticket, but it will stay in the database as evidence that the employee makes silly requests.&lt;br /&gt;
* deleted: the ticket never should have been in the system (maybe it was spam, a list of passwords, etc) -- and is now being zapped for good.&lt;br /&gt;
&lt;br /&gt;
A watcher is someone who is interested in a ticket. You&#039;ll find these filed under &amp;quot;People&amp;quot; when you&#039;re looking at a ticket. A watcher of a ticket normally gets email-copies of all the replies to the ticket. The watchers who are staff-members get copies of the comments too. There are several types, or roles, of watchers:&lt;br /&gt;
&lt;br /&gt;
* Owner: the person responsible for the ticket and its resolution. Each ticket can have only one owner. As a ticket is worked on, it may be passed from one owner to another.&lt;br /&gt;
* Requestor: the person or people who asked for something to get done; the ticket&#039;s reason for being. The Requestor normally gets copies of all replies to the ticket, but no comments.&lt;br /&gt;
* Cc: someone (or someones) who should get copies of any &#039;&#039;&#039;replies&#039;&#039;&#039; that go to the requestor. This might be the requestor&#039;s boss, sales rep, etc. This person will see the emails but doesn&#039;t necessarily have the right to work on the ticket.&lt;br /&gt;
* AdminCc: a Cc or Ccs that also gets copies of &#039;&#039;&#039;comments&#039;&#039;&#039; and generally are allowed to work on the ticket.&lt;br /&gt;
&lt;br /&gt;
We&#039;re hedging with words like &amp;quot;generally&amp;quot; and &amp;quot;necessarily&amp;quot; because any role can be assigned any right.&lt;br /&gt;
&lt;br /&gt;
You can also, as you work on a ticket, define its relationship to something. Relationships in RT can be ticket-to-ticket, but can also link tickets to external items like URLs or FedEx shipping numbers. For the sake of simplicity, we&#039;ll refer only to tickets in the following explanation of relationship types:&lt;br /&gt;
&lt;br /&gt;
* DEPENDS ON: the ticket can&#039;t be resolved unless another ticket is also resolved. The converse is depended on by.&lt;br /&gt;
* REFERS TO: the ticket doesn&#039;t need the other ticket, but it would sure be useful for you to look at it. The converse is referred to by.&lt;br /&gt;
* PARENT: a big, general ticket (&amp;quot;Move house.&amp;quot;)&lt;br /&gt;
* CHILD: a subproject of a parent (&amp;quot;Hire movers.&amp;quot; &amp;quot;Pack.&amp;quot; &amp;quot;Eat pizza.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
[[CustomField]]s are, yes, database fields that your organization can make up according to its needs. For details, see the Custom Fields section in [[ManualAdministration]]. An example custom field might be &#039;&#039;&#039;Resolution&#039;&#039;&#039;: FIXED, WORKSFORME, WONTFIX, UPSTREAM, etc.&lt;br /&gt;
&lt;br /&gt;
[[Scrip]]s are custom events that will automatically take Action X in response to Condition Y. You could have RT notify the Requestor when a ticket is resolved, for instance, or have RT page you when your boss submits a request. RT comes with many standard scrips, and you can define your own. For details, see the Scrips section in [[ManualAdministration]]. And no, we didn&#039;t misspell &amp;quot;scripts.&amp;quot; We made up a new word. Try it, it&#039;s fun.&lt;br /&gt;
&lt;br /&gt;
Now that you are (we hope) clear on the concepts, you&#039;re ready to start using RT.&lt;br /&gt;
&lt;br /&gt;
Up: [[UserManual]] --- Next: [[ManualRequirements]]&lt;br /&gt;
[[Category:RT User Manual]]&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualIntroduction&amp;diff=26721</id>
		<title>ManualIntroduction</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualIntroduction&amp;diff=26721"/>
		<updated>2019-03-19T14:47:15Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Up: [[UserManual]] --- Next: [[ManualRequirements]]&lt;br /&gt;
&lt;br /&gt;
Welcome to Request Tracker (RT), your new favorite ticketing system. This introduction explains what ticketing is and what RT is. If you&#039;re already familiar with RT, you can skip ahead.&lt;br /&gt;
&lt;br /&gt;
= About Ticketing =&lt;br /&gt;
&lt;br /&gt;
In some contexts, when people think about a &amp;quot;ticket,&amp;quot; they&#039;re talking about a code on their phone or a physical piece of paper that gets them into an event or on an airplane for a flight. The RT type of ticketing is a way for organizations to keep track of their to-do lists, who is working on which tasks, what&#039;s already been done, and when tasks were completed. You will also hear the phrase &amp;quot;trouble ticketing&amp;quot; bandied about, though there does not have to be a problem for ticketing to be useful. &amp;quot;Issue tracking&amp;quot; is another common phrase used for general ticketing.&lt;br /&gt;
&lt;br /&gt;
Ticketing can make life easier for many people and departments in an organization -- basically anyone who needs to keep track of a list of tasks. And it can be used with a variety of tasks, like fixing software bugs, answering customer service requests, or tracking security issues.&lt;br /&gt;
&lt;br /&gt;
Tickets can be a simple record of work done, like &amp;quot;Applied software patches on server,&amp;quot; or detailed records with many custom fields and a long history. How you use tickets in RT will depend on your use case and can differ from queue to queue. Whatever your approach, it&#039;s good to communicate with users so everyone understand why and how they should interact with the system.&lt;br /&gt;
&lt;br /&gt;
= About RT =&lt;br /&gt;
&lt;br /&gt;
RT is a ticketing system for all sizes of organizations. It is available under the terms of the GNU General Public License (GPL), so it doesn&#039;t cost anything to set up and use. We&#039;ll get into the technical features later, but for now, let&#039;s look at how RT might work:&lt;br /&gt;
&lt;br /&gt;
* Billy has a problem with his Bananamaster 3000, so he sends email to help@example.com&lt;br /&gt;
* RT records the new issue in its database and sends Billy an electronic &amp;quot;ticket stub&amp;quot; containing the new ticket&#039;s ID number and, ideally, some helpful information. He can refer to the ticket stub if he needs to send another email later.&lt;br /&gt;
* RT forwards Billy&#039;s email to a set of staff members.&lt;br /&gt;
* One of the staff members, Jane, is the company&#039;s Bananamaster expert. So Jane takes over Billy&#039;s issue and drafts a reply to Billy, which RT automatically records and forwards to him.&lt;br /&gt;
* Billy is a happy customer; Jane resolves the issue and heads down to the pub for a pint.&lt;br /&gt;
&lt;br /&gt;
This workflow is flexible, can be customized for your organization, and need not involve bananas.&lt;br /&gt;
&lt;br /&gt;
= RT concepts =&lt;br /&gt;
&lt;br /&gt;
There are some words and phrases you should understand in the context of RT before you begin. See [[RTGlossary]] for more definitions.&lt;br /&gt;
&lt;br /&gt;
A [[Ticket]] is the central object in RT, the thing that needs to get done. Tickets have metadata attached to them such as an owner, status, and queue - we&#039;ll get to all that in a minute.&lt;br /&gt;
&lt;br /&gt;
A [[Queue]] is the central administrative domain of RT; it keeps things organized. As the name implies, it&#039;s a line of tickets waiting to be worked on, but it&#039;s also, to some extent, the ticket&#039;s category. For instance, you might have the right to create, delete, and comment on tickets in the Foo queue, but only the right to comment on tickets in the Bar queue.&lt;br /&gt;
&lt;br /&gt;
A ticket&#039;s history is what it sounds like: everything that&#039;s happened to a ticket. Facets of ticket history could include when the ticket was created, how it has changed, and any comments about it or replies to it. Like real history, ticket history typically is not changed. However, new laws related to user privacy like [https://docs.bestpractical.com/rt/latest/GDPR.html GDPR] in the EU require some organizations to evaluate their auditing policies and decide how to handle requests to remove personal user data. This can require ticket data to be modified or removed completely.&lt;br /&gt;
&lt;br /&gt;
Ticket updates can take one of two forms. A reply is a public remark that a requestor can see. A comment is a private note for staff not visible to the requestor. This is useful when you want to be tactful but still convey important information, like, &amp;quot;This requestor is an investor, so be nice&amp;quot; or &amp;quot;This user&#039;s request mentioned his &#039;PC&#039; but he really has a Mac.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Priority, how important a ticket is, is represented as numerical scale from 0-99, with 99 being the highest priority. By setting a final priority, you can make a ticket&#039;s priority increase or decrease as its due date draws closer. The difference between 20, 50, and 75 may vary from organization to organization, but there should be an organizational policy or every ticket will get rated 99 by anxious users. [[ManualAdministration]] contains a useful model for setting organizational policy for priority. You can also install the [https://metacpan.org/pod/RT::Extension::PriorityAsString PriorityAsString] extension to manage priority with terms like &amp;quot;high&amp;quot; and &amp;quot;low&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The status drop-down menu offers several choices for classifying each ticket. Here&#039;s what they mean:&lt;br /&gt;
&lt;br /&gt;
* new: the ticket has just been created and hasn&#039;t been touched yet.&lt;br /&gt;
* open: the ticket is getting worked on&lt;br /&gt;
* stalled: due to circumstances beyond your control (waiting for the requestor to respond, waiting for the owner to return from Sri Lanka), the ticket isn&#039;t getting worked on right now. It will open again when someone adds a comment or reply.&lt;br /&gt;
* resolved: hooray! Work on the ticket has been completed and is out of everyone&#039;s hair.&lt;br /&gt;
* rejected: the ticket is not the staff&#039;s problem and is not going to be resolved, but is, for some reason, worth recording in the system. For instance, if an employee asks approval for something ridiculous, you can reject the ticket, but it will stay in the database as evidence that the employee makes silly requests.&lt;br /&gt;
* deleted: the ticket never should have been in the system (maybe it was spam, a list of passwords, etc) -- and is now being zapped for good.&lt;br /&gt;
&lt;br /&gt;
A watcher is someone who is interested in a ticket. You&#039;ll find these filed under &amp;quot;People&amp;quot; when you&#039;re looking at a ticket. A watcher of a ticket normally gets email-copies of all the replies to the ticket. The watchers who are staff-members get copies of the comments too. There are several types, or roles, of watchers:&lt;br /&gt;
&lt;br /&gt;
* Owner: the person responsible for the ticket and its resolution. Each ticket can have only one owner. As a ticket is worked on, it may be passed from one owner to another.&lt;br /&gt;
* Requestor: the person or people who asked for something to get done; the ticket&#039;s reason for being. The Requestor normally gets copies of all replies to the ticket, but no comments.&lt;br /&gt;
* Cc: someone (or someones) who should get copies of any &#039;&#039;&#039;replies&#039;&#039;&#039; that go to the requestor. This might be the requestor&#039;s boss, sales rep, etc. This person will see the emails but doesn&#039;t necessarily have the right to work on the ticket.&lt;br /&gt;
* AdminCc: a Cc or Ccs that also gets copies of &#039;&#039;&#039;comments&#039;&#039;&#039; and generally are allowed to work on the ticket.&lt;br /&gt;
&lt;br /&gt;
We&#039;re hedging with words like &amp;quot;generally&amp;quot; and &amp;quot;necessarily&amp;quot; because any role can be assigned any right.&lt;br /&gt;
&lt;br /&gt;
You can also, as you work on a ticket, define its relationship to something. Relationships in RT can be ticket-to-ticket, but can also link tickets to external items like URLs or FedEx shipping numbers. For the sake of simplicity, we&#039;ll refer only to tickets in the following explanation of relationship types:&lt;br /&gt;
&lt;br /&gt;
* DEPENDS ON: the ticket can&#039;t be resolved unless another ticket is also resolved. The converse is depended on by.&lt;br /&gt;
* REFERS TO: the ticket doesn&#039;t need the other ticket, but it would sure be useful for you to look at it. The converse is referred to by.&lt;br /&gt;
* PARENT: a big, general ticket (&amp;quot;Move house.&amp;quot;)&lt;br /&gt;
* CHILD: a subproject of a parent (&amp;quot;Hire movers.&amp;quot; &amp;quot;Pack.&amp;quot; &amp;quot;Eat pizza.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
[[CustomField]]s are, yes, database fields that your organization can make up according to its needs. For details, see the Custom Fields section in [[ManualAdministration]]. An example custom field might be &#039;&#039;&#039;Resolution&#039;&#039;&#039;: FIXED, WORKSFORME, WONTFIX, UPSTREAM, etc.&lt;br /&gt;
&lt;br /&gt;
[[Scrip]]s are custom events that will automatically take Action X in response to Condition Y. You could have RT notify the Requestor when a ticket is resolved, for instance, or have RT page you when your boss submits a request. RT comes with many standard scrips, and you can define your own. For details, see the Scrips section in [[ManualAdministration]]. And no, we didn&#039;t misspell &amp;quot;scripts.&amp;quot; We made up a new word. Try it, it&#039;s fun.&lt;br /&gt;
&lt;br /&gt;
Now that you are (we hope) clear on the concepts, you&#039;re ready to start using RT.&lt;br /&gt;
&lt;br /&gt;
Up: [[UserManual]] --- Next: [[ManualRequirements]]&lt;br /&gt;
[[Category:RT User Manual]]&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=REST&amp;diff=26626</id>
		<title>REST</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=REST&amp;diff=26626"/>
		<updated>2018-11-01T14:25:33Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
&lt;br /&gt;
The REST Interface gives you access to your RT Database. The complete communication is encapsulated in the HTTP protocol. The interface should be accessible in your installation.&lt;br /&gt;
&lt;br /&gt;
Though you may see references to older 3.x releases of RT below, Best Practice indicates that the REST stuff has not changed in any significant way in 4.x as of, at least, 1/2012.&lt;br /&gt;
&lt;br /&gt;
[{{SERVER}}/index.php?search={{TALKPAGENAME}}&amp;amp;title=Special:Search Legacy Comments] are available from the previous Wikia instance.&lt;br /&gt;
&lt;br /&gt;
== Interface ==&lt;br /&gt;
&lt;br /&gt;
Base URL: &amp;lt;code&amp;gt;.../REST/1.0/&amp;lt;/code&amp;gt;. The default response should be:&lt;br /&gt;
&lt;br /&gt;
    RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
    # Invalid object specification: &#039;index.html&#039;&lt;br /&gt;
&lt;br /&gt;
    id: index.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
The REST Interface does not support HTTP-Authentication. So you must get a valid Session-Token and submit the cookie each request. You usually get a Session-Cookie by submitting the default login form. Use variables &amp;quot;&amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt;&amp;quot; for login and &amp;quot;&amp;lt;code&amp;gt;pass&amp;lt;/code&amp;gt;&amp;quot; for password values. wget doesn&#039;t escape any characters in the --post-data option so make sure you properly escape any special characters in the password.&lt;br /&gt;
&lt;br /&gt;
See the wget invocation line below:&lt;br /&gt;
&lt;br /&gt;
    wget  --keep-session-cookies \&lt;br /&gt;
    --save-cookies cookies.txt \&lt;br /&gt;
    --post-data &#039;user=UUUU&amp;amp;pass=PPPP&#039; \&lt;br /&gt;
    http://my.rt.server&lt;br /&gt;
&lt;br /&gt;
You need the -keep-session-cookies option to make wget save session cookies.&lt;br /&gt;
&lt;br /&gt;
=== Ticket ===&lt;br /&gt;
&lt;br /&gt;
==== Ticket Properties ====&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single ticket, not including the history and comments.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.4.5 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;&lt;br /&gt;
 Queue: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Owner: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Creator: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Subject: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Status: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Priority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 InitialPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 FinalPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Requestors: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Cc: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 AdminCc: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Created: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Starts: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Started: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Due: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Resolved: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Told: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeEstimated: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeWorked: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeLeft: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Links ====&lt;br /&gt;
&lt;br /&gt;
Gets the ticket links for a single ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links/show&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.2 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&lt;br /&gt;
 HasMember: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 ReferredToBy: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 DependedOnBy: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 MemberOf: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 RefersTo: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 DependsOn: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachments ====&lt;br /&gt;
&lt;br /&gt;
Gets a list of all attachments related to the ticket&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachment ====&lt;br /&gt;
Gets the metadata and content of a specific attachment.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments/&amp;amp;lt;attachment-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.8.0 200 Ok&lt;br /&gt;
 &lt;br /&gt;
id: &amp;lt;attachment-id&amp;gt;&lt;br /&gt;
Subject:&lt;br /&gt;
Creator: &amp;lt;user-id&amp;gt;&lt;br /&gt;
Created: &amp;lt;timestamp&amp;gt;&lt;br /&gt;
Transaction: &amp;lt;transaction-id&amp;gt;&lt;br /&gt;
Parent: &amp;lt;parent-id&amp;gt;&lt;br /&gt;
MessageId:&lt;br /&gt;
Filename: &amp;lt;filename&amp;gt;&lt;br /&gt;
ContentType: application/octet-stream&lt;br /&gt;
ContentEncoding: none&lt;br /&gt;
 &lt;br /&gt;
Headers: MIME-Version: 1.0&lt;br /&gt;
         X-Mailer: MIME-tools 5.427 (Entity 5.427)&lt;br /&gt;
         Content-Type: application/octet-stream;&lt;br /&gt;
           name=&amp;quot;&amp;lt;filename&amp;gt;&amp;quot;&lt;br /&gt;
         Content-Disposition: inline; filename=&amp;quot;&amp;lt;filename&amp;gt;&amp;quot;&lt;br /&gt;
         Content-Transfer-Encoding: base64&lt;br /&gt;
         Content-Length: &amp;lt;length in bytes&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Content: ...&lt;br /&gt;
         ...&lt;br /&gt;
         ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE: RT returns the content indented with 9 spaces on each line, so that it lines up with the &amp;quot;Content:&amp;quot; header. Even if you strip this out with a regexp, the content is still UTF-8, which is probably not what you want. To get the original binary data back, strip out the 9 spaces with a regexp, strip off the 3 carriage returns at the end, and then convert the whole thing from UTF-8 to the native character encoding of the attachment, whatever that is. RT doesn&#039;t tell you, so you have know. If the attachments were uploaded by a U.S. Windows system, odds are that Windows-1252 is what you want. If you can&#039;t get the binary back intact, see the next method below.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachment Content ====&lt;br /&gt;
&lt;br /&gt;
Gets the attachment data content without additional metadata or whitespace characters&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments/&amp;amp;lt;attachment-id&amp;amp;gt;/content&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.0 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
So to get the original content you still have to strip the first 2 lines of the response.&lt;br /&gt;
&lt;br /&gt;
==== Ticket History ====&lt;br /&gt;
Gets a list of all the history items for a given ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;history-count&amp;gt;/&amp;lt;history-count&amp;gt; (/total)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;history-id&amp;gt;: &amp;lt;history-name&amp;gt;&lt;br /&gt;
&amp;lt;history-id&amp;gt;: &amp;lt;history-name&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get an additional row, for each history entry found. The first entry is usually: &amp;quot;&amp;lt;code&amp;gt;Ticket created by ...&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
There are two ways to get history item detail: you can do one of these and then recursively perform &amp;lt;code&amp;gt;ticket/history/id/&amp;amp;lt;history-id&amp;amp;gt;&amp;lt;/code&amp;gt; for each history-id from this REST call, but that is extremely wasteful and will scale horribly. What you really want to do is one REST call but get the long format:&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history?format=l&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.8.2 200 Ok&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;n&amp;gt;/&amp;lt;n&amp;gt; (id/&amp;amp;lt;history-id&amp;amp;gt;/total)&lt;br /&gt;
&lt;br /&gt;
id: &amp;lt;history-id&amp;gt;&lt;br /&gt;
Ticket: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
TimeTaken: &amp;lt;...&amp;gt;&lt;br /&gt;
Type: &amp;lt;...&amp;gt;&lt;br /&gt;
Field: &amp;lt;...&amp;gt;&lt;br /&gt;
OldValue: &amp;lt;...&amp;gt;&lt;br /&gt;
NewValue: &amp;lt;...&amp;gt;&lt;br /&gt;
Data: &amp;lt;...&amp;gt;&lt;br /&gt;
Description: &amp;lt;...&amp;gt;&lt;br /&gt;
Content: &amp;lt;...&amp;gt;&lt;br /&gt;
Creator: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Created: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attachments:&lt;br /&gt;
             &amp;lt;attachment-id&amp;gt;: &amp;lt;filename&amp;gt; (&amp;lt;size&amp;gt;)&lt;br /&gt;
             &amp;lt;attachment-id&amp;gt;: &amp;lt;filename&amp;gt; (&amp;lt;size&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;n&amp;gt;/&amp;lt;n&amp;gt; (id/&amp;amp;lt;history-id&amp;amp;gt;/total)&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE: the double dash &amp;quot;--&amp;quot; will occur in the long format between each history item. You can split the output on &amp;quot;--&amp;quot; and iterate over it, parsing out the data with an RFC822 parser, such as an email handling library.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Ticket History Entry ====&lt;br /&gt;
Gets the history information for a single history item. Note that the history item must actually correspond to the ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history/id/&amp;amp;lt;history-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
# 70/70 (id/114856/total)&lt;br /&gt;
&lt;br /&gt;
id: &amp;lt;history-id&amp;gt;&lt;br /&gt;
Ticket: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
TimeTaken: &amp;lt;...&amp;gt;&lt;br /&gt;
Type: &amp;lt;...&amp;gt;&lt;br /&gt;
Field: &amp;lt;...&amp;gt;&lt;br /&gt;
OldValue: &amp;lt;...&amp;gt;&lt;br /&gt;
NewValue: &amp;lt;...&amp;gt;&lt;br /&gt;
Data: &amp;lt;...&amp;gt;&lt;br /&gt;
Description: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Content: &amp;lt;lin1-0&amp;gt;&lt;br /&gt;
         &amp;lt;line-1&amp;gt;&lt;br /&gt;
         ...&lt;br /&gt;
         &amp;lt;line-n&amp;gt;&lt;br /&gt;
         &lt;br /&gt;
Creator: &amp;lt;...&amp;gt;&lt;br /&gt;
Created: &amp;lt;...&amp;gt;&lt;br /&gt;
Attachments: &amp;lt;...&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IMPORTANT NOTE: At least with RT 3.8.0, when you request a history item with this method AND you have attached a file that has Mime type text/plain to the same item (eg. a comment with an attachement), RT will return the complete content of the attachment for the key &amp;quot;Content:&amp;quot; and not your real comment that you can see in the web frontend. This may lead to some problems if the requestor does not expect to get a comment content that is for example 1.8 MB of text. With other Mime type attachments this however seems to work. I don&#039;t know if this is a feature or a bug.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &#039;&#039;&#039;Ticket Search&#039;&#039;&#039; ====&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=&amp;amp;lt;query&amp;amp;gt;&amp;amp;orderby=&amp;amp;lt;sort-order&amp;amp;gt;&amp;amp;format=&amp;amp;lt;format&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;query&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use any query generated by the query builder - or feel free to write your own. Here an example that will do the following: Find all tickets that have no owner and the status new or open&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;query= Owner = &#039;Nobody&#039; AND ( Status = &#039;new&#039; OR Status = &#039;open&#039; )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: to get all the tickets in &amp;quot;fooQueue&amp;quot; you&#039;d access:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: to get the tickets for a custom field &amp;quot;Contact Name&amp;quot; you&#039;d access:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=&#039;CF.{Contact Name}&#039;=&#039;Shaun Wallace&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;orderby&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By this parameter you can change the sort field and order of the search result. To sort a list ascending just put a + before the fieldname, otherwise a -. Eg: -Created (will put the newest tickets at the beginning).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;amp;orderby=+Created&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;format&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* i: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;&lt;br /&gt;
* s: &amp;amp;lt;ticket-id&amp;amp;gt;: &amp;amp;lt;ticket-subject&amp;amp;gt;&lt;br /&gt;
* l: a multi-line format&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;amp;orderby=+Created&amp;amp;format=i&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fields&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A list of fields you would like included in the result set.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=id=42&amp;amp;format=l&amp;amp;fields=Subject,Status,Priority,CF.\{Category\}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that you may need to escape characters like the curly braces for CFs.&lt;br /&gt;
&lt;br /&gt;
==== &#039;&#039;&#039;Ticket Create&#039;&#039;&#039; ====&lt;br /&gt;
&lt;br /&gt;
To create a new ticket: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/new&amp;lt;/code&amp;gt; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line, example:&lt;br /&gt;
&lt;br /&gt;
Testing the new ticket section&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: ticket/new&lt;br /&gt;
Queue: &amp;lt;queue name&amp;gt;&lt;br /&gt;
Requestor: &amp;lt;requestor email address&amp;gt;&lt;br /&gt;
Subject: &amp;lt;subject&amp;gt;&lt;br /&gt;
Cc: &amp;lt;...&amp;gt;&lt;br /&gt;
AdminCc: &amp;lt;...&amp;gt;&lt;br /&gt;
Owner: &amp;lt;...&amp;gt;&lt;br /&gt;
Status: &amp;lt;...&amp;gt;&lt;br /&gt;
Priority: &amp;lt;...&amp;gt;&lt;br /&gt;
InitialPriority: &amp;lt;...&amp;gt;&lt;br /&gt;
FinalPriority: &amp;lt;...&amp;gt;&lt;br /&gt;
TimeEstimated: &amp;lt;...&amp;gt;&lt;br /&gt;
Starts: &amp;lt;...&amp;gt;&lt;br /&gt;
Due: &amp;lt;...&amp;gt;&lt;br /&gt;
Text: &amp;lt;The ticket content&amp;gt;&lt;br /&gt;
CF-&amp;lt;CustomFieldName&amp;gt;: &amp;lt;CustomFieldValue&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are any &amp;quot;special&amp;quot; characters (Umlauts, dash, ...?) in a custom field&#039;s name, you can still access it via its ID:&lt;br /&gt;
 CF-$id: &amp;lt;Value&amp;gt;&lt;br /&gt;
If you want to have a multiline Text, prefix every line with a blank.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Due: &amp;lt;...&amp;gt;&lt;br /&gt;
Text: This is &lt;br /&gt;
 a &lt;br /&gt;
 multiline Text&lt;br /&gt;
 !!!&lt;br /&gt;
CF-&amp;lt;CustomFieldName&amp;gt;: &amp;lt;CustomFieldValue&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response should look like: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/4.0.6 200 Ok&lt;br /&gt;
&lt;br /&gt;
# Ticket 775 created.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== curl example =====&lt;br /&gt;
    &lt;br /&gt;
  * Create a file containing the ticket form:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: ticket/new&lt;br /&gt;
Queue: queue1&lt;br /&gt;
Requestor: requestor@email&lt;br /&gt;
Priority: 4&lt;br /&gt;
CF-Type of request: Demande&lt;br /&gt;
Subject: Test REST&lt;br /&gt;
Text: Multi line&lt;br /&gt;
 test with&lt;br /&gt;
 special chars: é&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  * Submit using curl:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
curl --data-urlencode content@file.name &#039;https://HOSTNAME/REST/1.0/ticket/new?user=USER&amp;amp;pass=PASSWORD&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Ticket Edit ====&lt;br /&gt;
To update an existing ticket: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/edit&amp;lt;/code&amp;gt; with a variable named &amp;quot;content&amp;quot;, containing &amp;quot;key: value&amp;quot; line by line (like the one displayed when issuing &amp;lt;code&amp;gt;ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;). Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Priority: 5&lt;br /&gt;
TimeWorked: 15&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*PHP&lt;br /&gt;
   &amp;lt;pre&amp;gt; &lt;br /&gt;
                    $username = rt_user;&lt;br /&gt;
                    $password = rt_pass;&lt;br /&gt;
                    $url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/&amp;lt;ticket id&amp;gt;/edit?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
                    $request = new HttpRequest($url, HTTP_METH_POST);&lt;br /&gt;
                    $post_data=array(&amp;quot;content&amp;quot;=&amp;gt;&amp;quot;AdminCc: userX\nText: This is a REST test edit ticket\n&amp;quot;);&lt;br /&gt;
                    &lt;br /&gt;
                    // add the post fields  &lt;br /&gt;
                    $request-&amp;gt;addPostFields($postData);&lt;br /&gt;
                    // response from RT&lt;br /&gt;
                    $response = $request-&amp;gt;send()-&amp;gt;getBody();&lt;br /&gt;
                    print_r($response);&lt;br /&gt;
                    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tickets History Reply ====&lt;br /&gt;
Same as comment: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/comment&amp;lt;/code&amp;gt; with a variable name &amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
Action: correspond&lt;br /&gt;
Text: the text comment&lt;br /&gt;
Cc: &amp;lt;...&amp;gt;&lt;br /&gt;
Bcc: &amp;lt;...&amp;gt;&lt;br /&gt;
TimeWorked: &amp;lt;...&amp;gt;&lt;br /&gt;
Attachment: an attachment filename/path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Cc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Bcc&amp;lt;/code&amp;gt; are for this reply only (&#039;&#039;I think&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
==== Ticket History Comment ====&lt;br /&gt;
To add a comment to an existing ticket: POST on &amp;quot;&amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/comment&amp;lt;/code&amp;gt;&amp;quot; with a variable name &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
Action: comment&lt;br /&gt;
Text: the text comment&lt;br /&gt;
Attachment: an attachment filename/path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Action can be &amp;quot;&amp;lt;code&amp;gt;comment&amp;lt;/code&amp;gt;&amp;quot; or &amp;quot;&amp;lt;code&amp;gt;correspond&amp;lt;/code&amp;gt;&amp;quot;. For a list of fields you can use in correspondence, try &amp;quot;&amp;lt;code&amp;gt;/opt/rt3/bin/rt correspond ticket/1&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your comment contains multiple lines, each new line must be preceded by a space (e.g. &amp;quot;line 1\n line 2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you want to use HTML replies, use &amp;lt;pre&amp;gt;Content-Type: text/html&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you used &amp;quot;&amp;lt;code&amp;gt;Attachment&amp;lt;/code&amp;gt;&amp;quot;, you must add to your POST a variable &amp;quot;&amp;lt;code&amp;gt;attachment_1&amp;lt;/code&amp;gt;&amp;quot; that contains the raw attachment in multi-part file object.&lt;br /&gt;
&lt;br /&gt;
You can upload more attachments as well, in this case you have to separate the file names in the &amp;quot;&amp;lt;code style=&amp;quot;border-style: initial; border-color: initial; &amp;quot;&amp;gt;Attachment&amp;lt;/code&amp;gt;&amp;quot; with &amp;quot;\n &amp;quot;(a newline and space, without quotes) and add a new variable &amp;quot;attachment_$i&amp;quot; to your POST where $i is the index of attachment.&lt;br /&gt;
&lt;br /&gt;
You need to send header to post comments&lt;br /&gt;
&lt;br /&gt;
==== Ticket Links Edit ====&lt;br /&gt;
To update links on an existing ticket: POST on &amp;quot;&amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&amp;lt;/code&amp;gt;&amp;quot; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line (like the one displayed when issuing &amp;quot;&amp;lt;code&amp;gt;ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&amp;lt;/code&amp;gt;&amp;quot;). Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DependsOn: 54354&lt;br /&gt;
RefersTo: http://some.external/link&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== User Properties ===&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single user.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/user/&amp;amp;lt;user-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.4 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: user/&amp;amp;lt;user-id&amp;amp;gt;&lt;br /&gt;
 Name: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Password: ********&lt;br /&gt;
 EmailAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 RealName: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Organization: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Privileged: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Disabled: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also you can use user login instead of user ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ===&lt;br /&gt;
&lt;br /&gt;
==== User Create ====&lt;br /&gt;
&lt;br /&gt;
To create a new user: post on &amp;lt;code&amp;gt;/REST/1.0/user/new&amp;lt;/code&amp;gt; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line, like the response to &amp;lt;code&amp;gt;/user/&amp;amp;lt;ticket-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== User Edit ====&lt;br /&gt;
To update an existing user: post on &amp;lt;code&amp;gt;/REST/1.0/user/&amp;amp;lt;user-id&amp;amp;gt;/edit&amp;lt;/code&amp;gt; with a variable named &amp;quot;content&amp;quot;, containing &amp;quot;key: value&amp;quot; line by line (like the one displayed when issuing &amp;lt;code&amp;gt;user/&amp;amp;lt;user-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Queue Properties ===&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single queue.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/queue/&amp;amp;lt;queue-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.4 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: queue/&amp;amp;lt;queue-id&amp;amp;gt;&lt;br /&gt;
 Name: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Description: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 CorrespondAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 CommentAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 InitialPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 FinalPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 DefaultDueIn: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Logout ===&lt;br /&gt;
&lt;br /&gt;
To logout: post on &amp;lt;code&amp;gt;/REST/1.0/logout&amp;lt;/code&amp;gt; with empty content.&lt;br /&gt;
&lt;br /&gt;
== Types ==&lt;br /&gt;
&lt;br /&gt;
*new&lt;br /&gt;
*open&lt;br /&gt;
*stalled&lt;br /&gt;
*resolved&lt;br /&gt;
*rejected&lt;br /&gt;
*deleted&lt;br /&gt;
+ other custom values defined in you local RT portal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== History entry type ===&lt;br /&gt;
* Create&lt;br /&gt;
* CustomField&lt;br /&gt;
* EmailRecord&lt;br /&gt;
* Status&lt;br /&gt;
* CommentEmailRecord&lt;br /&gt;
* Correspond&lt;br /&gt;
* Comment&lt;br /&gt;
* Priority&lt;br /&gt;
* Give&lt;br /&gt;
* Steal&lt;br /&gt;
* Take&lt;br /&gt;
* Untake&lt;br /&gt;
* AddWatcher&lt;br /&gt;
* DeleteWatcher&lt;br /&gt;
* AddLink&lt;br /&gt;
* DeleteLink&lt;br /&gt;
* AddReminder&lt;br /&gt;
* OpenReminder&lt;br /&gt;
* ResolveReminder&lt;br /&gt;
* Set&lt;br /&gt;
* Force&lt;br /&gt;
* Subject&lt;br /&gt;
* Told&lt;br /&gt;
* PurgeTransaction&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
=== Data format ===&lt;br /&gt;
&lt;br /&gt;
* History entries time returns in UTC, boolean returns as &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; (true) and &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;(false). &lt;br /&gt;
&lt;br /&gt;
* Use only &amp;lt;code&amp;gt;&amp;quot;\n&amp;quot;&amp;lt;/code&amp;gt;, not &amp;lt;code&amp;gt;&amp;quot;\r\n&amp;quot;&amp;lt;/code&amp;gt;in post content. &lt;br /&gt;
&lt;br /&gt;
* Comments in response body starts with with a hash (&amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;) symbol.&lt;br /&gt;
&lt;br /&gt;
=== Request status ===&lt;br /&gt;
To get real request/post status you need to check status code in first line of server response.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Perl ===&lt;br /&gt;
To get the results of a single request (without setting the Session-Cookie) - assuming you&#039;ve set:&lt;br /&gt;
&lt;br /&gt;
* $uri to your RT REST URL&lt;br /&gt;
* $access_user to your username&lt;br /&gt;
* $access_password to your password&lt;br /&gt;
* $ticketNumber to the ticket you want to see&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
my $ua = LWP::UserAgent-&amp;amp;gt;new;&lt;br /&gt;
$ua-&amp;gt;timeout(10);&lt;br /&gt;
$ua-&amp;gt;agent(&amp;quot;YOURUSERAGENTHERE&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
my $response = $ua-&amp;gt;post($uri.&amp;quot;ticket/$ticketNumber&amp;quot;,&lt;br /&gt;
   [&#039;user&#039; =&amp;gt; $access_user, &#039;pass&#039; =&amp;gt; $access_password],&lt;br /&gt;
    &#039;Content_Type&#039; =&amp;gt; &#039;form-data&#039;);&lt;br /&gt;
&lt;br /&gt;
if ($response-&amp;amp;gt;is_success) {&lt;br /&gt;
   print $response-&amp;gt;decoded_content;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import org.apache.commons.httpclient.HttpClient;&lt;br /&gt;
import org.apache.commons.httpclient.methods.PostMethod;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.Part;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.StringPart;&lt;br /&gt;
  &lt;br /&gt;
public class RtTicketCreator {&lt;br /&gt;
   static final String BASE_URI = &amp;quot;http://rt.xxx.com/REST/1.0&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
   public static void main(String[] args) throws IOException {&lt;br /&gt;
 &lt;br /&gt;
      PostMethod mPost = new PostMethod(BASE_URI + &amp;quot;/ticket/new?user=username&amp;amp;amp;pass=password&amp;quot;);&lt;br /&gt;
      Part[] parts = { new StringPart(&amp;quot;content&amp;quot;, &amp;quot;Queue: General\nSubject: 123&amp;quot;) };&lt;br /&gt;
      mPost.setRequestEntity(new MultipartRequestEntity(parts, mPost.getParams()));&lt;br /&gt;
      HttpClient cl = new HttpClient();&lt;br /&gt;
      cl.executeMethod(mPost);&lt;br /&gt;
      System.out.println(mPost.getResponseBodyAsString());&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Java ( Based on new Apache HttpComponents library ) ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
* RT ticket creator based on the current Apache HttpComponents library 4.1.3&lt;br /&gt;
* Created by Koustubha Kale, kmkale at youtility dot in&lt;br /&gt;
*/&lt;br /&gt;
import org.apache.http.HttpEntity;&lt;br /&gt;
import org.apache.http.HttpResponse;&lt;br /&gt;
import org.apache.http.auth.AuthScope;&lt;br /&gt;
import org.apache.http.auth.UsernamePasswordCredentials;&lt;br /&gt;
import org.apache.http.client.HttpClient;&lt;br /&gt;
import org.apache.http.client.methods.HttpPost;&lt;br /&gt;
import org.apache.http.entity.mime.MultipartEntity;&lt;br /&gt;
import org.apache.http.entity.mime.content.StringBody;&lt;br /&gt;
import org.apache.http.impl.client.DefaultHttpClient;&lt;br /&gt;
import org.apache.http.util.EntityUtils;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class NewApacheHttpcomponentsRtTicketCreator {&lt;br /&gt;
&lt;br /&gt;
    public static void main(String[] args) throws Exception {&lt;br /&gt;
        &lt;br /&gt;
        DefaultHttpClient httpclient = new DefaultHttpClient();&lt;br /&gt;
	try {&lt;br /&gt;
            &lt;br /&gt;
            HttpPost httppost = new HttpPost(&amp;quot;http://rt.xxx.com/rt/REST/1.0&amp;quot; +&lt;br /&gt;
                    &amp;quot;/ticket/new?user=username&amp;amp;pass=password&amp;quot;);&lt;br /&gt;
	    StringBody content = new StringBody(&amp;quot;Queue: General\nSubject: 123&amp;quot;);&lt;br /&gt;
	    MultipartEntity reqEntity = new MultipartEntity();&lt;br /&gt;
	    reqEntity.addPart(&amp;quot;content&amp;quot;, content);&lt;br /&gt;
	    httppost.setEntity(reqEntity);&lt;br /&gt;
	    System.out.println(&amp;quot;executing request &amp;quot; + httppost.getRequestLine());&lt;br /&gt;
            HttpResponse response = httpclient.execute(httppost);&lt;br /&gt;
            HttpEntity resEntity = response.getEntity();&lt;br /&gt;
&lt;br /&gt;
            System.out.println(&amp;quot;----------------------------------------&amp;quot;);&lt;br /&gt;
            System.out.println(response.getStatusLine());&lt;br /&gt;
            if (resEntity != null) {&lt;br /&gt;
                System.out.println(&amp;quot;Response content length: &amp;quot; + resEntity.getContentLength());&lt;br /&gt;
            }&lt;br /&gt;
            EntityUtils.consume(resEntity);&lt;br /&gt;
        } finally {&lt;br /&gt;
            try { httpclient.getConnectionManager().shutdown(); } catch (Exception ignore) {}&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import cookielib&lt;br /&gt;
import urllib&lt;br /&gt;
import urllib2&lt;br /&gt;
       &lt;br /&gt;
# creates a cookie for the rtserver with the credentials given at initialization.&lt;br /&gt;
# define your credentials here&lt;br /&gt;
access_user = &#039;your_login&#039;&lt;br /&gt;
access_password = &#039;your_password&#039;&lt;br /&gt;
       &lt;br /&gt;
# here is the RequestTracker URI we try to access&lt;br /&gt;
uri = &#039;http://your-rt-instance.com/REST/1.0/&#039;&lt;br /&gt;
       &lt;br /&gt;
# trying login on rt server&lt;br /&gt;
cj = cookielib.LWPCookieJar()&lt;br /&gt;
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))&lt;br /&gt;
urllib2.install_opener(opener)&lt;br /&gt;
data = {&#039;user&#039;: access_user, &#039;pass&#039;: access_password}&lt;br /&gt;
ldata = urllib.urlencode(data)&lt;br /&gt;
login = urllib2.Request(uri, ldata)&lt;br /&gt;
try:&lt;br /&gt;
   response = urllib2.urlopen(login)&lt;br /&gt;
   print response.read()&lt;br /&gt;
   print &amp;quot;login successful&amp;quot;&lt;br /&gt;
except urllib2.URLError:&lt;br /&gt;
   # could not connect to server&lt;br /&gt;
   print &amp;quot;Not able to login&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ruby ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env ruby&lt;br /&gt;
require &#039;net/http&#039;&lt;br /&gt;
&lt;br /&gt;
user = &#039;username&#039;&lt;br /&gt;
pass = &#039;password&#039;&lt;br /&gt;
uri = URI(&#039;https://rt.example.com/REST/1.0/ticket/123/show&#039;)&lt;br /&gt;
&lt;br /&gt;
req = Net::HTTP::Post.new(uri.path)&lt;br /&gt;
req.set_form_data(&#039;user&#039; =&amp;gt; user, &#039;pass&#039; =&amp;gt; pass)&lt;br /&gt;
&lt;br /&gt;
res = Net::HTTP.start(uri.hostname, uri.port, &lt;br /&gt;
  :use_ssl =&amp;gt; uri.scheme == &#039;https&#039;, &lt;br /&gt;
  :set_debug_output =&amp;gt; $stderr) do |http|&lt;br /&gt;
  http.request(req)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
case res&lt;br /&gt;
when Net::HTTPSuccess, Net::HTTPRedirection&lt;br /&gt;
  # OK&lt;br /&gt;
  puts &amp;quot;HTTP response code:  #{res.code}&amp;quot;&lt;br /&gt;
  puts &amp;quot;HTTP message: #{res.message}&amp;quot;&lt;br /&gt;
  puts &amp;quot;Response:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  res.each do |key,val|&lt;br /&gt;
    puts &amp;quot;#{key} =&amp;gt; #{val}&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  puts &amp;quot;Data:&amp;quot;&lt;br /&gt;
  puts res.body&lt;br /&gt;
else&lt;br /&gt;
  res.value&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PHP ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$username = rt_user;&lt;br /&gt;
$password = rt_pass;&lt;br /&gt;
$url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/&amp;lt;ticket id&amp;gt;/show?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
$request = new HttpRequest($url, HTTP_METH_GET);&lt;br /&gt;
/* if you want&#039;s to pass additional parameters */&lt;br /&gt;
$request-&amp;gt;addQueryData(array());&lt;br /&gt;
$response = $request-&amp;gt;send();&lt;br /&gt;
print_r($response);&lt;br /&gt;
&amp;lt;/pre&amp;gt; OR&amp;lt;pre&amp;gt;&lt;br /&gt;
$username = rt_user;&lt;br /&gt;
$password = rt_pass;&lt;br /&gt;
$url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/new?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
$request = new HttpRequest($url, HTTP_METH_POST);&lt;br /&gt;
// Note : to add data in custom fields you need to add element like below example&lt;br /&gt;
// in $post_data array&lt;br /&gt;
// Example : \nCF-customfield1:testdata&lt;br /&gt;
$post_data=array(&amp;quot;content&amp;quot;=&amp;gt;&amp;quot;Queue: General\nRequestor: user@domain\nSubject: REST test 1\nOwner: userX\nAdminCc: userX\nText: This is a REST test\n&amp;quot;);&lt;br /&gt;
$request-&amp;gt;addPostFields($post_data);&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
response = $request-&amp;gt;send()-&amp;gt;getBody();&lt;br /&gt;
print_r($response);&lt;br /&gt;
}catch (HttpException $ex) {&lt;br /&gt;
echo $ex;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C# ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Using &amp;quot;WCF REST Starter Kit&amp;quot; (http://msdn.microsoft.com/en-us/netframework/cc950529.aspx)&lt;br /&gt;
using (var client = new HttpClient(&amp;quot;http://rt.site.com/REST/1.0/&amp;quot;))&lt;br /&gt;
{&lt;br /&gt;
   client.TransportSettings.Cookies = new CookieContainer();&lt;br /&gt;
&lt;br /&gt;
   var form = new HttpUrlEncodedForm();&lt;br /&gt;
   form.Add(&amp;quot;user&amp;quot;, &amp;quot;LOGIN&amp;quot;);&lt;br /&gt;
   form.Add(&amp;quot;pass&amp;quot;, &amp;quot;PASSWORD&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
   client.Post(string.Empty, form.CreateHttpContent());&lt;br /&gt;
&lt;br /&gt;
   // 1. Get ticket data&lt;br /&gt;
   using (var request = client.Get(&amp;quot;ticket/1234/show&amp;quot;))&lt;br /&gt;
   {&lt;br /&gt;
      string content = request.Content.ReadAsString();&lt;br /&gt;
      // Some logic&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // 2. Post ticket reply with attachment&lt;br /&gt;
   var formPost = new HttpMultipartMimeForm();&lt;br /&gt;
   byte[] attachment = new byte[];&lt;br /&gt;
   string content = string.Empty;&lt;br /&gt;
         &lt;br /&gt;
   // Store data in attachment&lt;br /&gt;
   // Store data in content string (&amp;quot;Field: Value&amp;quot; line by line)&lt;br /&gt;
   // ...&lt;br /&gt;
         &lt;br /&gt;
   formPost.Add(&amp;quot;content&amp;quot;, content);&lt;br /&gt;
   formPost.Add(&amp;quot;attachment_1&amp;quot;, &amp;quot;attachment_1&amp;quot;, HttpContent.Create(attachment, &amp;quot;application/octet-stream&amp;quot;));&lt;br /&gt;
                             &lt;br /&gt;
   using (var post = client.Post(&amp;quot;ticket/1234/comment&amp;quot;), formPost.CreateHttpContent()))&lt;br /&gt;
      // Some logic&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Powershell (v3)===&lt;br /&gt;
* Escape Powershell reserved chars in user/pass&lt;br /&gt;
* If connecting via SSL, use fqdn of server, not cname&lt;br /&gt;
*Use `n (newline) when composing new ticket structure&lt;br /&gt;
Read RT queue based on query: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$servername=&amp;quot;Your Servername here&amp;quot;&lt;br /&gt;
$u=&amp;quot;user=Username&amp;quot;&lt;br /&gt;
$p=&amp;quot;pass=Password&amp;quot;&lt;br /&gt;
$q=&amp;quot;search/ticket?query=(Status=&#039;open&#039; OR Status=&#039;new&#039;) AND (Queue=&#039;GENERAL&#039; OR Queue=&#039;FOO&#039;) AND Owner=&#039;Nobody&#039;&amp;quot;&lt;br /&gt;
$uri=&amp;quot;https://&amp;quot; + $servername + &amp;quot;/rt/REST/1.0/&amp;quot; + $q + &amp;quot;&amp;amp;&amp;quot; + $u + &amp;quot;&amp;amp;&amp;quot; + $p&lt;br /&gt;
$RT=Invoke-WebRequest -Uri  $uri -SessionVariable sess&lt;br /&gt;
$rt.Content&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===VB.NET===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Public Sub AddAttachmentToRT(ByVal url As String, ByVal fileName As String, ByVal filePath As String)&lt;br /&gt;
&lt;br /&gt;
        Dim dataBoundary As String = &amp;quot;--xYzZY&amp;quot;&lt;br /&gt;
        Dim request As HttpWebRequest&lt;br /&gt;
        Dim fileType As String = &amp;quot;image/jpeg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        &#039;Create a POST web request to the REST interface using the passed URL&lt;br /&gt;
        request = CType(WebRequest.Create(url), HttpWebRequest)&lt;br /&gt;
        request.ContentType = &amp;quot;multipart/form-data; boundary=xYzZY&amp;quot;&lt;br /&gt;
        request.Method = &amp;quot;POST&amp;quot;&lt;br /&gt;
        request.KeepAlive = True&lt;br /&gt;
&lt;br /&gt;
        &#039;Write the request to the requestStream&lt;br /&gt;
        Using requestStream As IO.Stream = request.GetRequestStream()&lt;br /&gt;
&lt;br /&gt;
            &#039;Create a variable &amp;quot;attachment_1&amp;quot; in the POST, specify the file name and file type&lt;br /&gt;
            Dim preAttachment As String = dataBoundary + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Disposition: form-data; name=&amp;quot;&amp;quot;attachment_1&amp;quot;&amp;quot;; filename=&amp;quot;&amp;quot;&amp;quot; + fileName + &amp;quot;&amp;quot;&amp;quot;&amp;quot; + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Type: &amp;quot; + fileType + vbCrLf _&lt;br /&gt;
            + vbCrLf&lt;br /&gt;
&lt;br /&gt;
            &#039;Convert this preAttachment string to bytes&lt;br /&gt;
            Dim preAttachmentBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(preAttachment)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write this preAttachment string to the stream&lt;br /&gt;
            requestStream.Write(preAttachmentBytes, 0, preAttachmentBytes.Length)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write the file as bytes to the stream by passing its exact location&lt;br /&gt;
            Using fileStream As New IO.FileStream(Server.MapPath(filePath + fileName), IO.FileMode.Open, IO.FileAccess.Read)&lt;br /&gt;
&lt;br /&gt;
                Dim buffer(4096) As Byte&lt;br /&gt;
                Dim bytesRead As Int32 = fileStream.Read(buffer, 0, buffer.Length)&lt;br /&gt;
&lt;br /&gt;
                Do While (bytesRead &amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
                    requestStream.Write(buffer, 0, bytesRead)&lt;br /&gt;
                    bytesRead = fileStream.Read(buffer, 0, buffer.Length)&lt;br /&gt;
&lt;br /&gt;
                Loop&lt;br /&gt;
&lt;br /&gt;
            End Using&lt;br /&gt;
&lt;br /&gt;
            &#039;Create a variable named content in the POST, specify the attachment name and comment text&lt;br /&gt;
            Dim postAttachment As String = vbCrLf _&lt;br /&gt;
            + dataBoundary + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Disposition: form-data; name=&amp;quot;&amp;quot;content&amp;quot;&amp;quot;&amp;quot; + vbCrLf _&lt;br /&gt;
            + vbCrLf _&lt;br /&gt;
            + &amp;quot;Action: comment&amp;quot; + vbLf _&lt;br /&gt;
            + &amp;quot;Attachment: &amp;quot; + fileName + vbCrLf _&lt;br /&gt;
            + &amp;quot;Text: Whatever You Want&amp;quot; + vbCrLf _&lt;br /&gt;
            + vbCrLf _&lt;br /&gt;
            + &amp;quot;--xYzZY--&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            &#039;Convert postAttachment string to bytes&lt;br /&gt;
            Dim postAttachmentBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(postAttachment)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write the postAttachment string to the stream&lt;br /&gt;
            requestStream.Write(postAttachmentBytes, 0, postAttachmentBytes.Length)&lt;br /&gt;
&lt;br /&gt;
        End Using&lt;br /&gt;
&lt;br /&gt;
        Dim response As Net.WebResponse = Nothing&lt;br /&gt;
&lt;br /&gt;
        &#039;Get the response from our REST request to RT&lt;br /&gt;
        &#039;Required to capture response, without this Try-Catch attaching will fail&lt;br /&gt;
        Try&lt;br /&gt;
            response = request.GetResponse()&lt;br /&gt;
&lt;br /&gt;
            Using responseStream As IO.Stream = response.GetResponseStream()&lt;br /&gt;
&lt;br /&gt;
                Using responseReader As New IO.StreamReader(responseStream)&lt;br /&gt;
&lt;br /&gt;
                    Dim responseText = responseReader.ReadToEnd()&lt;br /&gt;
&lt;br /&gt;
                End Using&lt;br /&gt;
&lt;br /&gt;
            End Using&lt;br /&gt;
&lt;br /&gt;
        Catch exception As Net.WebException&lt;br /&gt;
&lt;br /&gt;
            response = exception.Response&lt;br /&gt;
&lt;br /&gt;
            If (response IsNot Nothing) Then&lt;br /&gt;
&lt;br /&gt;
                Using reader As New IO.StreamReader(response.GetResponseStream())&lt;br /&gt;
&lt;br /&gt;
                    Dim responseText = reader.ReadToEnd()&lt;br /&gt;
&lt;br /&gt;
                End Using&lt;br /&gt;
&lt;br /&gt;
                response.Close()&lt;br /&gt;
&lt;br /&gt;
            End If&lt;br /&gt;
&lt;br /&gt;
        Finally&lt;br /&gt;
&lt;br /&gt;
            request = Nothing&lt;br /&gt;
&lt;br /&gt;
        End Try&lt;br /&gt;
&lt;br /&gt;
    End Sub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===JavaScript===&lt;br /&gt;
This is an example of updating the RefersTo field for a ticket. Assuming Zepto/jQuery is also being used.&lt;br /&gt;
 function link_back(url, ticket_num, rt) {&lt;br /&gt;
     var data, link;&lt;br /&gt;
     link = &amp;quot;refersto: &amp;quot; + url;&lt;br /&gt;
     data = {&amp;quot;content&amp;quot;: link};&lt;br /&gt;
 &lt;br /&gt;
     $.ajax({&lt;br /&gt;
         type: &amp;quot;POST&amp;quot;,&lt;br /&gt;
         url: rt + ticket_num + &amp;quot;/links&amp;quot;,&lt;br /&gt;
         data: data,&lt;br /&gt;
         success: function (reply) {&lt;br /&gt;
             console.log(reply);&lt;br /&gt;
         }&lt;br /&gt;
     });&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 var url = &amp;quot;https://www.wikipedia.org/&amp;quot;;&lt;br /&gt;
 var ticket_num = &amp;quot;123456&amp;quot;;&lt;br /&gt;
 var rt = &amp;quot;https://some.rt.url/REST/1.0/ticket/&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 link_back(url, ticket_num, rt);&lt;br /&gt;
&lt;br /&gt;
== Convenience libraries ==&lt;br /&gt;
&lt;br /&gt;
There are libraries which do much of the low-level work shown in the examples below for you, and provide an easier programming interface for dealing with RT:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Language&lt;br /&gt;
!Package/Module&lt;br /&gt;
!Source&lt;br /&gt;
!Example&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Perl&#039;&#039;&#039;&lt;br /&gt;
|[http://metacpan.org/module/RT::Client::REST RT::Client::REST]&lt;br /&gt;
|[http://rt-client-rest.googlecode.com/svn/trunk/ Google Code]&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;quot;perl -MCPAN -e install RT::Client::REST&amp;quot;&amp;lt;/code&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Ruby&#039;&#039;&#039;&lt;br /&gt;
|[http://rubygems.org/gems/rt-client rt-client]&lt;br /&gt;
|[https://github.com/uidzip/rt-client GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;gem install rt-client&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Ruby&#039;&#039;&#039;&lt;br /&gt;
|[http://rubygems.org/gems/roart Roart]&lt;br /&gt;
|[https://github.com/pjdavis/roart GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;gem install roart&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/Rickerd0613/rtapi rtapi]&lt;br /&gt;
|[https://github.com/Rickerd0613/rtapi GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;pip install rtapi&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/z4r/python-rtkit rtkit]&lt;br /&gt;
|[https://github.com/z4r/python-rtkit GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;pip install python-rtkit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/CZ-NIC/python-rt python-rt]&lt;br /&gt;
|[https://github.com/CZ-NIC/python-rt Github]&lt;br /&gt;
|&amp;lt;code&amp;gt;pip install rt&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Java&#039;&#039;&#039;&lt;br /&gt;
|[http://projects.boksa.de/RT-REST/ RT-REST]&lt;br /&gt;
|[https://github.com/bboksa/RT-REST GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;N/A&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;PHP&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/dersam/RTPHPLib RTPHPLib]&lt;br /&gt;
|[https://github.com/dersam/RTPHPLib GitHub]&lt;br /&gt;
|composer require dersam/rt-php-lib&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=NotificationsTuning&amp;diff=26581</id>
		<title>NotificationsTuning</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=NotificationsTuning&amp;diff=26581"/>
		<updated>2018-05-23T18:50:18Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: /* Patch to send less notifications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NotificationsTuning =&lt;br /&gt;
&lt;br /&gt;
This page describes a team organization example, and how we send notifications. We talk about an IT team, managing servers and applications.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
We have in our RT many queues, and from 2 to 4 adminccs per queue. The incoming tickets arrive in an INCOMING queue and are dispatched by some people to the appropriate queue. When a ticket enters a queue, it belongs to nobody and one of the adminccs takes the ticket (depending on the workload of each others, holidays etc...). Then the ticket lives and is resolved. I describe here the notifications we use, hoping it will help people. Any comments/optimizations/etc are welcome at the end of the file.&lt;br /&gt;
&lt;br /&gt;
= Summary =&lt;br /&gt;
&lt;br /&gt;
When a new ticket is created :&lt;br /&gt;
&lt;br /&gt;
* notify requestor with an autoreply&lt;br /&gt;
* notify owner he has a new ticket (if the ticket was created and assigned at the same time)&lt;br /&gt;
* notify adminccs of the queue that a new ticket is available in their queue&lt;br /&gt;
&lt;br /&gt;
When there is an owner change :&lt;br /&gt;
&lt;br /&gt;
* notify (new) owner&lt;br /&gt;
* notify other adminccs that the ticket is taken by one of them (so they don&#039;t have to take care of it)&lt;br /&gt;
&lt;br /&gt;
When there is a queue change :&lt;br /&gt;
&lt;br /&gt;
* notify adminccs of the new queue there is a new ticket&lt;br /&gt;
&lt;br /&gt;
When there is a correspondance on a ticket (reply):&lt;br /&gt;
&lt;br /&gt;
* notify requestors, ccs&lt;br /&gt;
* notify other recipients&lt;br /&gt;
* notify owner&lt;br /&gt;
* notify adminccs&lt;br /&gt;
&lt;br /&gt;
When there is a comment on a ticket :&lt;br /&gt;
&lt;br /&gt;
* notify owner&lt;br /&gt;
* notify admincc&lt;br /&gt;
&lt;br /&gt;
When a ticket is resolved :&lt;br /&gt;
&lt;br /&gt;
* notify requestor&lt;br /&gt;
* notify adminccs someone (one of them) resolved the ticket&lt;br /&gt;
&lt;br /&gt;
I created new templates starting with &amp;quot;MY&amp;quot; and associated them to scrips. I put in these templates what makes sense to me, and I added a line explaining the reason why you receive this mail.&lt;br /&gt;
&lt;br /&gt;
= Patch to send less notifications =&lt;br /&gt;
&lt;br /&gt;
But with this configuration (and with the default one), we had a problem : we received too many emails for the same thing : For example :&lt;br /&gt;
&lt;br /&gt;
* a (privilieged) user sends a request to RT for a task he has to do.&lt;br /&gt;
* people managing tickets assign it to him, and put it in a queue he is admincc for&lt;br /&gt;
&lt;br /&gt;
So this user is requestor, owner, and admincc : he gets 3 emails on each correspondance.&lt;br /&gt;
&lt;br /&gt;
This is the patch (ugly patch but it works) I applied to lib/RT/Action/Notify.pm (well, I created a new file local/lib/RT/Action/Notify.pm) . It has been tested on RT 3.8.2 and 3.8.7 :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   # cat Notify.patch&lt;br /&gt;
 --- /Notify.pm.orig   2010-01-06 16:03:20.000000000 +0100&lt;br /&gt;
 +++ Notify.pm 2010-02-01 16:36:00.000000000 +0100&lt;br /&gt;
 @@ -85,6 +85,11 @@&lt;br /&gt;
      $arg =~ s/\bAll\b/Owner,Requestor,AdminCc,Cc/;&lt;br /&gt;
 &lt;br /&gt;
      my ( @To, @PseudoTo, @Cc, @Bcc );&lt;br /&gt;
 +    my $requestor_emails = join(&#039; &#039;,($ticket-&amp;gt;Requestors-&amp;gt;MemberEmailAddresses));&lt;br /&gt;
 +    my $admincc_emails = join(&#039; &#039;,($ticket-&amp;gt;AdminCc-&amp;gt;MemberEmailAddresses));&lt;br /&gt;
 +    my $owner_email = join(&#039; &#039;,($ticket-&amp;gt;OwnerObj-&amp;gt;EmailAddress));&lt;br /&gt;
 +    my $queueadmincc_emails = join(&#039; &#039;,($ticket-&amp;gt;QueueObj-&amp;gt;AdminCc-&amp;gt;MemberEmailAddresses));&lt;br /&gt;
 +    my @requestor_emails_array = split(/ /,$requestor_emails);&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
      if ( $arg =~ /\bOtherRecipients\b/ ) {&lt;br /&gt;
 @@ -115,7 +120,7 @@&lt;br /&gt;
          }&lt;br /&gt;
      }&lt;br /&gt;
 &lt;br /&gt;
 -    if ( $arg =~ /\bOwner\b/ &amp;amp;&amp;amp; $ticket-&amp;gt;OwnerObj-&amp;gt;id != $RT::Nobody-&amp;gt;id ) {&lt;br /&gt;
 +    if ( $arg =~ /\bOwner\b/ &amp;amp;&amp;amp; $ticket-&amp;gt;OwnerObj-&amp;gt;id != $RT::Nobody-&amp;gt;id &amp;amp;&amp;amp; $requestor_emails !~ $owner_email ){&lt;br /&gt;
          # If we&#039;re not sending to Ccs or requestors,&lt;br /&gt;
          # then the Owner can be the To.&lt;br /&gt;
          if (@To) {&lt;br /&gt;
 @@ -128,8 +133,18 @@&lt;br /&gt;
      }&lt;br /&gt;
 &lt;br /&gt;
      if ( $arg =~ /\bAdminCc\b/ ) {&lt;br /&gt;
 -        push ( @Bcc, $ticket-&amp;gt;AdminCc-&amp;gt;MemberEmailAddresses  );&lt;br /&gt;
 -        push ( @Bcc, $ticket-&amp;gt;QueueObj-&amp;gt;AdminCc-&amp;gt;MemberEmailAddresses  );&lt;br /&gt;
 +     # Notification already sent for requestor&lt;br /&gt;
 +     foreach (@requestor_emails_array){&lt;br /&gt;
 +             $admincc_emails =~ s/$_//g;&lt;br /&gt;
 +             $queueadmincc_emails =~ s/$_//g;&lt;br /&gt;
 +     }&lt;br /&gt;
 +     # Notification already sent for owner&lt;br /&gt;
 +     $admincc_emails =~ s/$owner_email//g;&lt;br /&gt;
 +     $queueadmincc_emails =~ s/$owner_email//g;&lt;br /&gt;
 +&lt;br /&gt;
 +        push ( @Bcc, $admincc_emails );&lt;br /&gt;
 +        push ( @Bcc, $queueadmincc_emails );&lt;br /&gt;
 +&lt;br /&gt;
      }&lt;br /&gt;
 &lt;br /&gt;
      if ( RT-&amp;gt;Config-&amp;gt;Get(&#039;UseFriendlyToLine&#039;) ) {&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
This is what the patch does :&lt;br /&gt;
&lt;br /&gt;
* always send an email to the requestor for a correspondance (&amp;quot;Reply&amp;quot;)&lt;br /&gt;
* if user is requestor and owner, do not send to the owner (an email has already been sent to the requestor)&lt;br /&gt;
* if a user is requestor or owner and admincc, remove him from the list of admincc (as he has already been notified either because he&#039;s a requestor or a owner) and send the email to this list of admincc .&lt;br /&gt;
&lt;br /&gt;
That also means the template received by the user depends on his role (sometimes he will receive the requestor template, sometimes the owner, sometimes the admincc). But as basically it&#039;s the same thing, we don&#039;t mind.&lt;br /&gt;
&lt;br /&gt;
This is the test matrix :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ROA  | S |  P | T&lt;br /&gt;
 ------------------&lt;br /&gt;
 000  | x |  x | x&lt;br /&gt;
 001  | 1 |  1 | A&lt;br /&gt;
 010  | 1 |  1 | O&lt;br /&gt;
 011  | 2 |  1 | O&lt;br /&gt;
 100  | 1 |  1 | R&lt;br /&gt;
 101  | 2 |  1 | R&lt;br /&gt;
 110  | 2 |  1 | R&lt;br /&gt;
 111  | 3 |  1 | R&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* R : is requestor&lt;br /&gt;
* O : is owner&lt;br /&gt;
* A : is admincc&lt;br /&gt;
&lt;br /&gt;
* S : Number of emails sent with Standard notify.pm&lt;br /&gt;
* P : Number of emails sent with Patched notify.pm&lt;br /&gt;
* T : Template used (Requestor, Owner, [[AdminCc]])&lt;br /&gt;
&lt;br /&gt;
I&#039;ve not managed the Cc part, and the comments because our main problem was the duplicate emails generated by correspondences.&lt;br /&gt;
&lt;br /&gt;
And it works very well. No more useless notifications.&lt;br /&gt;
&lt;br /&gt;
= Details of the Global scrips : =&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Id Description                             Stage                    Condition       Action                     Template&lt;br /&gt;
 -------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
 1 Autoreply                                TransactionCreate        User Defined    Autoreply To Requestors    Autoreply&lt;br /&gt;
 2 On Create Notify Owner                   TransactionCreate        On Create       Notify Owner               MY Create Notify Owner template&lt;br /&gt;
 3 On Create Notify AdminCcs                TransactionCreate        On Create       Notify AdminCcs            MY Create Notify AdminCc template&lt;br /&gt;
 &lt;br /&gt;
 4 On Owner Change Notify Owner             TransactionCreate        On Owner Change Notify Owner               MY Owner Change Notify Owner template&lt;br /&gt;
 5 On Owner Change Notify AdminCc           TransactionCreate        On Owner Change Notify AdminCcs as Comment MY Comment ChangeOwner&lt;br /&gt;
 6 On Queue Change Notify AdminCcs          TransactionCreate        On Queue Change Notify AdminCcs            MY Queue Change Notify AdminCcs&lt;br /&gt;
 &lt;br /&gt;
 7 On Correspond Open Tickets               TransactionCreate        On Correspond   Open Tickets               Blank&lt;br /&gt;
 8 On Correspond Notify Requestors and Ccs  TransactionCreate        On Correspond   Notify Requestors and Ccs  MY Correspond Notify Requestor and Ccs&lt;br /&gt;
 9 On Correspond Notify Other Recipients    TransactionCreate        On Correspond   Notify Other Recipients    MY Correspond Notify Other recipients&lt;br /&gt;
 10 On Correspond Notify Owner              TransactionCreate        On Correspond   Notify Owner               MY Correspond Notify Owner&lt;br /&gt;
 11 On Correspond Notify AdminCcs           TransactionCreate        On Correspond   Notify AdminCcs            MY Correspond Notify AdminCc&lt;br /&gt;
 &lt;br /&gt;
 12 On Comment Notify AdminCcs as Comment   TransactionCreate        On Comment      Notify AdminCcs as Comment MY Comment AdminCc&lt;br /&gt;
 13 On Comment Notify Owner as Comment      TransactionCreate        On Comment      Notify Owner as Comment    MY Comment Owner&lt;br /&gt;
 &lt;br /&gt;
 14 On Resolve Notify Requestors            TransactionCreate        On Resolve      Notify Requestors          MY Ticket Resolved&lt;br /&gt;
 15 On Resolve Notify AdminCcs              TransactionCreate        On Resolve      Notify AdminCcs as Comment MY Comment AdminCc Resolved&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Templates =&lt;br /&gt;
&lt;br /&gt;
Here are the templates :&lt;br /&gt;
&lt;br /&gt;
1) Default&lt;br /&gt;
&lt;br /&gt;
2) MY Create Notify Owner template&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RT-Attach-Message: yes&lt;br /&gt;
 &lt;br /&gt;
 You receive this email because you are owner of a new ticket.&lt;br /&gt;
 &lt;br /&gt;
 This new ticket has been created and assigned to you:&lt;br /&gt;
 &lt;br /&gt;
 =====================================================================&lt;br /&gt;
     Ticket: {$RT::WebURL}Ticket/Display.html?id={$Ticket-&amp;amp;gt;id}&lt;br /&gt;
      Queue: {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name}&lt;br /&gt;
 Requestors: {$Ticket-&amp;amp;gt;RequestorAddresses}&lt;br /&gt;
     Owner: {$Ticket-&amp;amp;gt;OwnerObj-&amp;amp;gt;Name}&lt;br /&gt;
    Status: {$Ticket-&amp;amp;gt;Status}&lt;br /&gt;
   Subject: &amp;quot;{$Transaction-&amp;amp;gt;Subject || $Ticket-&amp;amp;gt;Subject || &amp;quot;(No subject given)&amp;quot;}&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 {$Transaction-&amp;amp;gt;Content()}&lt;br /&gt;
 =====================================================================&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) MY Create Notify [[AdminCc]] template&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RT-Attach-Message: yes&lt;br /&gt;
 &lt;br /&gt;
 You receive this email because you are AdminCc of {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name} queue.&lt;br /&gt;
 &lt;br /&gt;
 A new ticket has been created in this queue.&lt;br /&gt;
 &lt;br /&gt;
 Click here to take it :{$RT::WebURL}Ticket/Display.html?Action=Take&amp;amp;amp;id={$Ticket-&amp;amp;gt;id}&lt;br /&gt;
 &lt;br /&gt;
 =====================================================================&lt;br /&gt;
     Ticket: {$RT::WebURL}Ticket/Display.html?id={$Ticket-&amp;amp;gt;id}&lt;br /&gt;
      Queue: {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name}&lt;br /&gt;
 Requestors: {$Ticket-&amp;amp;gt;RequestorAddresses}&lt;br /&gt;
      Owner: {$Ticket-&amp;amp;gt;OwnerObj-&amp;amp;gt;Name}&lt;br /&gt;
     Status: {$Ticket-&amp;amp;gt;Status}&lt;br /&gt;
    Subject: &amp;quot;{$Transaction-&amp;amp;gt;Subject || $Ticket-&amp;amp;gt;Subject || &amp;quot;(No subject given)&amp;quot;}&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 {$Transaction-&amp;amp;gt;Content()}&lt;br /&gt;
 =====================================================================&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4) MY Owner Change Notify Owner template&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;You receive this email because you become owner of this ticket.&lt;br /&gt;
 &lt;br /&gt;
 You are now the owner of ticket #{$Ticket-&amp;amp;gt;id}&lt;br /&gt;
 &lt;br /&gt;
 =====================================================================&lt;br /&gt;
     Ticket: {$RT::WebURL}Ticket/Display.html?id={$Ticket-&amp;amp;gt;id}&lt;br /&gt;
      Queue: {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name}&lt;br /&gt;
 Requestors: {$Ticket-&amp;amp;gt;RequestorAddresses}&lt;br /&gt;
      Owner: {$Ticket-&amp;amp;gt;OwnerObj-&amp;amp;gt;Name}&lt;br /&gt;
     Status: {$Ticket-&amp;amp;gt;Status}&lt;br /&gt;
    Subject: &amp;quot;{$Transaction-&amp;amp;gt;Subject || $Ticket-&amp;amp;gt;Subject || &amp;quot;(No subject given)&amp;quot;}&amp;quot;&lt;br /&gt;
 =====================================================================&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5) MY Comment [[ChangeOwner]]&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RT-Attach-Message: yes&lt;br /&gt;
 &lt;br /&gt;
 You receive this email because you are AdminCc on {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name} queue.&lt;br /&gt;
 &lt;br /&gt;
 Ticket taken by {$Ticket-&amp;amp;gt;OwnerObj-&amp;amp;gt;Name}.&lt;br /&gt;
 &lt;br /&gt;
 =====================================================================&lt;br /&gt;
     Ticket: {$RT::WebURL}Ticket/Display.html?id={$Ticket-&amp;amp;gt;id}&lt;br /&gt;
      Queue: {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name}&lt;br /&gt;
 Requestors: {$Ticket-&amp;amp;gt;RequestorAddresses}&lt;br /&gt;
      Owner: {$Ticket-&amp;amp;gt;OwnerObj-&amp;amp;gt;Name}&lt;br /&gt;
     Status: {$Ticket-&amp;amp;gt;Status}&lt;br /&gt;
    Subject: &amp;quot;{$Transaction-&amp;amp;gt;Subject || $Ticket-&amp;amp;gt;Subject || &amp;quot;(No subject given)&amp;quot;}&amp;quot;&lt;br /&gt;
 =====================================================================&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6) MY Queue Change Notify [[AdminCcs]]&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RT-Attach-Message: yes&lt;br /&gt;
 &lt;br /&gt;
 You receive this email because you are AdminCc of {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name} queue.&lt;br /&gt;
 &lt;br /&gt;
 {$Transaction-&amp;amp;gt;Description}&lt;br /&gt;
 &lt;br /&gt;
 =====================================================================&lt;br /&gt;
     Ticket: {$RT::WebURL}Ticket/Display.html?id={$Ticket-&amp;amp;gt;id}&lt;br /&gt;
      Queue: {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name}&lt;br /&gt;
 Requestors: {$Ticket-&amp;amp;gt;RequestorAddresses}&lt;br /&gt;
      Owner: {$Ticket-&amp;amp;gt;OwnerObj-&amp;amp;gt;Name}&lt;br /&gt;
     Status: {$Ticket-&amp;amp;gt;Status}&lt;br /&gt;
    Subject: &amp;quot;{$Transaction-&amp;amp;gt;Subject || $Ticket-&amp;amp;gt;Subject || &amp;quot;(No subject given)&amp;quot;}&amp;quot;&lt;br /&gt;
 =====================================================================&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7) Default&lt;br /&gt;
&lt;br /&gt;
8) MY Correspond Notify Requestor and Ccs&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RT-Attach-Message: yes&lt;br /&gt;
 &lt;br /&gt;
 You receive this email because you are Requestor or Cc on this ticket.&lt;br /&gt;
 &lt;br /&gt;
 {$Transaction-&amp;amp;gt;Description}&lt;br /&gt;
 &lt;br /&gt;
 =====================================================================&lt;br /&gt;
     Ticket: {$RT::WebURL}Ticket/Display.html?id={$Ticket-&amp;amp;gt;id}&lt;br /&gt;
      Queue: {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name}&lt;br /&gt;
 Requestors: {$Ticket-&amp;amp;gt;RequestorAddresses}&lt;br /&gt;
      Owner: {$Ticket-&amp;amp;gt;OwnerObj-&amp;amp;gt;Name}&lt;br /&gt;
     Status: {$Ticket-&amp;amp;gt;Status}&lt;br /&gt;
    Subject: &amp;quot;{$Transaction-&amp;amp;gt;Subject || $Ticket-&amp;amp;gt;Subject || &amp;quot;(No subject given)&amp;quot;}&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 {$Transaction-&amp;amp;gt;Content()}&lt;br /&gt;
 =====================================================================&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9) MY Correspond Notify Other recipients&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RT-Attach-Message: yes&lt;br /&gt;
 &lt;br /&gt;
 You receive this email because you are in the list of recipients of this ticket.&lt;br /&gt;
 &lt;br /&gt;
 {$Transaction-&amp;amp;gt;Description}&lt;br /&gt;
 &lt;br /&gt;
 =====================================================================&lt;br /&gt;
     Ticket: {$RT::WebURL}Ticket/Display.html?id={$Ticket-&amp;amp;gt;id}&lt;br /&gt;
      Queue: {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name}&lt;br /&gt;
 Requestors: {$Ticket-&amp;amp;gt;RequestorAddresses}&lt;br /&gt;
      Owner: {$Ticket-&amp;amp;gt;OwnerObj-&amp;amp;gt;Name}&lt;br /&gt;
     Status: {$Ticket-&amp;amp;gt;Status}&lt;br /&gt;
    Subject: &amp;quot;{$Transaction-&amp;amp;gt;Subject || $Ticket-&amp;amp;gt;Subject || &amp;quot;(No subject given)&amp;quot;}&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 {$Transaction-&amp;amp;gt;Content()}&lt;br /&gt;
 =====================================================================&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10) MY Correspond Notify Owner&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RT-Attach-Message: yes&lt;br /&gt;
 &lt;br /&gt;
 You receive this email because you are owner of this ticket.&lt;br /&gt;
 &lt;br /&gt;
 {$Transaction-&amp;amp;gt;Description}&lt;br /&gt;
 &lt;br /&gt;
 =====================================================================&lt;br /&gt;
     Ticket: {$RT::WebURL}Ticket/Display.html?id={$Ticket-&amp;amp;gt;id}&lt;br /&gt;
      Queue: {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name}&lt;br /&gt;
 Requestors: {$Ticket-&amp;amp;gt;RequestorAddresses}&lt;br /&gt;
      Owner: {$Ticket-&amp;amp;gt;OwnerObj-&amp;amp;gt;Name}&lt;br /&gt;
     Status: {$Ticket-&amp;amp;gt;Status}&lt;br /&gt;
    Subject: &amp;quot;{$Transaction-&amp;amp;gt;Subject || $Ticket-&amp;amp;gt;Subject || &amp;quot;(No subject given)&amp;quot;}&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 {$Transaction-&amp;amp;gt;Content()}&lt;br /&gt;
 =====================================================================&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
11) MY Correspond Notify [[AdminCc]]&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RT-Attach-Message: yes&lt;br /&gt;
 &lt;br /&gt;
 You receive this email because you are AdminCc on {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name} queue.&lt;br /&gt;
 &lt;br /&gt;
 {$Transaction-&amp;amp;gt;Description}&lt;br /&gt;
 &lt;br /&gt;
 =====================================================================&lt;br /&gt;
     Ticket: {$RT::WebURL}Ticket/Display.html?id={$Ticket-&amp;amp;gt;id}&lt;br /&gt;
      Queue: {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name}&lt;br /&gt;
 Requestors: {$Ticket-&amp;amp;gt;RequestorAddresses}&lt;br /&gt;
      Owner: {$Ticket-&amp;amp;gt;OwnerObj-&amp;amp;gt;Name}&lt;br /&gt;
     Status: {$Ticket-&amp;amp;gt;Status}&lt;br /&gt;
    Subject: &amp;quot;{$Transaction-&amp;amp;gt;Subject || $Ticket-&amp;amp;gt;Subject || &amp;quot;(No subject given)&amp;quot;}&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 {$Transaction-&amp;amp;gt;Content()}&lt;br /&gt;
 =====================================================================&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
12) MY Comment [[AdminCc]]&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RT-Attach-Message: yes&lt;br /&gt;
 &lt;br /&gt;
 You receive this email because you are AdminCc on {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name} queue.&lt;br /&gt;
 &lt;br /&gt;
 {$Transaction-&amp;amp;gt;Description}. This message is not sent to the requestors.&lt;br /&gt;
 &lt;br /&gt;
 =====================================================================&lt;br /&gt;
     Ticket: {$RT::WebURL}Ticket/Display.html?id={$Ticket-&amp;amp;gt;id}&lt;br /&gt;
      Queue: {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name}&lt;br /&gt;
 Requestors: {$Ticket-&amp;amp;gt;RequestorAddresses}&lt;br /&gt;
      Owner: {$Ticket-&amp;amp;gt;OwnerObj-&amp;amp;gt;Name}&lt;br /&gt;
     Status: {$Ticket-&amp;amp;gt;Status}&lt;br /&gt;
    Subject: &amp;quot;{$Transaction-&amp;amp;gt;Subject || $Ticket-&amp;amp;gt;Subject || &amp;quot;(No subject given)&amp;quot;}&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 {$Transaction-&amp;amp;gt;Content()}&lt;br /&gt;
 =====================================================================&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
13) MY Comment Owner&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RT-Attach-Message: yes&lt;br /&gt;
 &lt;br /&gt;
 You receive this email because you are Owner of this ticket.&lt;br /&gt;
 &lt;br /&gt;
 {$Transaction-&amp;amp;gt;Description}. This message is not sent to the requestors.&lt;br /&gt;
 &lt;br /&gt;
 =====================================================================&lt;br /&gt;
     Ticket: {$RT::WebURL}Ticket/Display.html?id={$Ticket-&amp;amp;gt;id}&lt;br /&gt;
      Queue: {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name}&lt;br /&gt;
 Requestors: {$Ticket-&amp;amp;gt;RequestorAddresses}&lt;br /&gt;
      Owner: {$Ticket-&amp;amp;gt;OwnerObj-&amp;amp;gt;Name}&lt;br /&gt;
     Status: {$Ticket-&amp;amp;gt;Status}&lt;br /&gt;
    Subject: &amp;quot;{$Transaction-&amp;amp;gt;Subject || $Ticket-&amp;amp;gt;Subject || &amp;quot;(No subject given)&amp;quot;}&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 {$Transaction-&amp;amp;gt;Content()}&lt;br /&gt;
 =====================================================================&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
14) MY Ticket Resolved&lt;br /&gt;
&lt;br /&gt;
 Subject: Resolved: {$Ticket-&amp;amp;gt;Subject}&lt;br /&gt;
 &lt;br /&gt;
 Request {$Ticket-&amp;amp;gt;id} was acted upon.&lt;br /&gt;
 &lt;br /&gt;
 Subject: {$Transaction-&amp;amp;gt;Subject || $Ticket-&amp;amp;gt;Subject || &amp;quot;(No subject given)&amp;quot;}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 According to our tests, your request has been resolved. If you have any&lt;br /&gt;
 further questions or concerns, please open a new ticket or reopen this one by replying to this email.&lt;br /&gt;
 &lt;br /&gt;
 {$Transaction-&amp;amp;gt;CreatedAsString}: {$Transaction-&amp;amp;gt;Description}&lt;br /&gt;
 Queue: {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name}&lt;br /&gt;
 Owner: {$Ticket-&amp;amp;gt;OwnerObj-&amp;amp;gt;Name}&lt;br /&gt;
 Requestors: {$Ticket-&amp;amp;gt;RequestorAddresses}&lt;br /&gt;
 &lt;br /&gt;
 Ticket &amp;amp;lt;URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket-&amp;amp;gt;id} &amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
15) MY Comment [[AdminCc]] Resolved&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RT-Attach-Message: yes&lt;br /&gt;
 &lt;br /&gt;
 You receive this email because you are AdminCc on {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name} queue.&lt;br /&gt;
 &lt;br /&gt;
 Ticket resolved by {$Ticket-&amp;amp;gt;OwnerObj-&amp;amp;gt;Name}.&lt;br /&gt;
 &lt;br /&gt;
 =====================================================================&lt;br /&gt;
     Ticket: {$RT::WebURL}Ticket/Display.html?id={$Ticket-&amp;amp;gt;id}&lt;br /&gt;
      Queue: {$Ticket-&amp;amp;gt;QueueObj-&amp;amp;gt;Name}&lt;br /&gt;
 Requestors: {$Ticket-&amp;amp;gt;RequestorAddresses}&lt;br /&gt;
      Owner: {$Ticket-&amp;amp;gt;OwnerObj-&amp;amp;gt;Name}&lt;br /&gt;
     Status: {$Ticket-&amp;amp;gt;Status}&lt;br /&gt;
    Subject: &amp;quot;{$Transaction-&amp;amp;gt;Subject || $Ticket-&amp;amp;gt;Subject || &amp;quot;(No subject given)&amp;quot;}&amp;quot;&lt;br /&gt;
 =====================================================================&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Discussions/remarks/etc... =&lt;br /&gt;
&lt;br /&gt;
Christophe {dot} Sahut {at} sgs {dot} com&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=REST&amp;diff=26497</id>
		<title>REST</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=REST&amp;diff=26497"/>
		<updated>2017-03-23T20:41:21Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: /* Convenience libraries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
&lt;br /&gt;
The REST Interface gives you access to your RT Database. The complete communication is encapsulated in the HTTP protocol. The interface should be accessible in your installation.&lt;br /&gt;
&lt;br /&gt;
Though you may see references to older 3.x releases of RT below, Best Practice indicates that the REST stuff has not changed in any significant way in 4.x as of, at least, 1/2012.&lt;br /&gt;
&lt;br /&gt;
[{{SERVER}}/index.php?search={{TALKPAGENAME}}&amp;amp;title=Special:Search Legacy Comments] are available from the previous Wikia instance.&lt;br /&gt;
&lt;br /&gt;
== Interface ==&lt;br /&gt;
&lt;br /&gt;
Base URL: &amp;lt;code&amp;gt;.../REST/1.0/&amp;lt;/code&amp;gt;. The default response should be:&lt;br /&gt;
&lt;br /&gt;
    RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
    # Invalid object specification: &#039;index.html&#039;&lt;br /&gt;
&lt;br /&gt;
    id: index.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
The REST Interface does not support HTTP-Authentication. So you must get a valid Session-Token and submit the cookie each request. You usually get a Session-Cookie by submitting the default login form. Use variables &amp;quot;&amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt;&amp;quot; for login and &amp;quot;&amp;lt;code&amp;gt;pass&amp;lt;/code&amp;gt;&amp;quot; for password values. wget doesn&#039;t escape any characters in the --post-data option so make sure you properly escape any special characters in the password.&lt;br /&gt;
&lt;br /&gt;
See the wget invocation line below:&lt;br /&gt;
&lt;br /&gt;
    wget  --keep-session-cookies \&lt;br /&gt;
    --save-cookies cookies.txt \&lt;br /&gt;
    --post-data &#039;user=UUUU&amp;amp;pass=PPPP&#039; \&lt;br /&gt;
    http://my.rt.server&lt;br /&gt;
&lt;br /&gt;
You need the -keep-session-cookies option to make wget save session cookies.&lt;br /&gt;
&lt;br /&gt;
=== Ticket ===&lt;br /&gt;
&lt;br /&gt;
==== Ticket Properties ====&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single ticket, not including the history and comments.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.4.5 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;&lt;br /&gt;
 Queue: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Owner: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Creator: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Subject: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Status: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Priority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 InitialPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 FinalPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Requestors: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Cc: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 AdminCc: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Created: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Starts: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Started: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Due: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Resolved: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Told: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeEstimated: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeWorked: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeLeft: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Links ====&lt;br /&gt;
&lt;br /&gt;
Gets the ticket links for a single ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links/show&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.2 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&lt;br /&gt;
 HasMember: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 ReferredToBy: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 DependedOnBy: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 MemberOf: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 RefersTo: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 DependsOn: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachments ====&lt;br /&gt;
&lt;br /&gt;
Gets a list of all attachments related to the ticket&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachment ====&lt;br /&gt;
Gets the metadata and content of a specific attachment.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments/&amp;amp;lt;attachment-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.8.0 200 Ok&lt;br /&gt;
 &lt;br /&gt;
id: &amp;lt;attachment-id&amp;gt;&lt;br /&gt;
Subject:&lt;br /&gt;
Creator: &amp;lt;user-id&amp;gt;&lt;br /&gt;
Created: &amp;lt;timestamp&amp;gt;&lt;br /&gt;
Transaction: &amp;lt;transaction-id&amp;gt;&lt;br /&gt;
Parent: &amp;lt;parent-id&amp;gt;&lt;br /&gt;
MessageId:&lt;br /&gt;
Filename: &amp;lt;filename&amp;gt;&lt;br /&gt;
ContentType: application/octet-stream&lt;br /&gt;
ContentEncoding: none&lt;br /&gt;
 &lt;br /&gt;
Headers: MIME-Version: 1.0&lt;br /&gt;
         X-Mailer: MIME-tools 5.427 (Entity 5.427)&lt;br /&gt;
         Content-Type: application/octet-stream;&lt;br /&gt;
           name=&amp;quot;&amp;lt;filename&amp;gt;&amp;quot;&lt;br /&gt;
         Content-Disposition: inline; filename=&amp;quot;&amp;lt;filename&amp;gt;&amp;quot;&lt;br /&gt;
         Content-Transfer-Encoding: base64&lt;br /&gt;
         Content-Length: &amp;lt;length in bytes&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Content: ...&lt;br /&gt;
         ...&lt;br /&gt;
         ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE: RT returns the content indented with 9 spaces on each line, so that it lines up with the &amp;quot;Content:&amp;quot; header. Even if you strip this out with a regexp, the content is still UTF-8, which is probably not what you want. To get the original binary data back, strip out the 9 spaces with a regexp, strip off the 3 carriage returns at the end, and then convert the whole thing from UTF-8 to the native character encoding of the attachment, whatever that is. RT doesn&#039;t tell you, so you have know. If the attachments were uploaded by a U.S. Windows system, odds are that Windows-1252 is what you want. If you can&#039;t get the binary back intact, see the next method below.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachment Content ====&lt;br /&gt;
&lt;br /&gt;
Gets the attachment data content without additional metadata or whitespace characters&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments/&amp;amp;lt;attachment-id&amp;amp;gt;/content&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.0 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
So to get the original content you still have to strip the first 2 lines of the response.&lt;br /&gt;
&lt;br /&gt;
==== Ticket History ====&lt;br /&gt;
Gets a list of all the history items for a given ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;history-count&amp;gt;/&amp;lt;history-count&amp;gt; (/total)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;history-id&amp;gt;: &amp;lt;history-name&amp;gt;&lt;br /&gt;
&amp;lt;history-id&amp;gt;: &amp;lt;history-name&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get an additional row, for each history entry found. The first entry is usually: &amp;quot;&amp;lt;code&amp;gt;Ticket created by ...&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
There are two ways to get history item detail: you can do one of these and then recursively perform &amp;lt;code&amp;gt;ticket/history/id/&amp;amp;lt;history-id&amp;amp;gt;&amp;lt;/code&amp;gt; for each history-id from this REST call, but that is extremely wasteful and will scale horribly. What you really want to do is one REST call but get the long format:&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history?format=l&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.8.2 200 Ok&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;n&amp;gt;/&amp;lt;n&amp;gt; (id/&amp;amp;lt;history-id&amp;amp;gt;/total)&lt;br /&gt;
&lt;br /&gt;
id: &amp;lt;history-id&amp;gt;&lt;br /&gt;
Ticket: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
TimeTaken: &amp;lt;...&amp;gt;&lt;br /&gt;
Type: &amp;lt;...&amp;gt;&lt;br /&gt;
Field: &amp;lt;...&amp;gt;&lt;br /&gt;
OldValue: &amp;lt;...&amp;gt;&lt;br /&gt;
NewValue: &amp;lt;...&amp;gt;&lt;br /&gt;
Data: &amp;lt;...&amp;gt;&lt;br /&gt;
Description: &amp;lt;...&amp;gt;&lt;br /&gt;
Content: &amp;lt;...&amp;gt;&lt;br /&gt;
Creator: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Created: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attachments:&lt;br /&gt;
             &amp;lt;attachment-id&amp;gt;: &amp;lt;filename&amp;gt; (&amp;lt;size&amp;gt;)&lt;br /&gt;
             &amp;lt;attachment-id&amp;gt;: &amp;lt;filename&amp;gt; (&amp;lt;size&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;n&amp;gt;/&amp;lt;n&amp;gt; (id/&amp;amp;lt;history-id&amp;amp;gt;/total)&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE: the double dash &amp;quot;--&amp;quot; will occur in the long format between each history item. You can split the output on &amp;quot;--&amp;quot; and iterate over it, parsing out the data with an RFC822 parser, such as an email handling library.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Ticket History Entry ====&lt;br /&gt;
Gets the history information for a single history item. Note that the history item must actually correspond to the ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history/id/&amp;amp;lt;history-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
# 70/70 (id/114856/total)&lt;br /&gt;
&lt;br /&gt;
id: &amp;lt;history-id&amp;gt;&lt;br /&gt;
Ticket: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
TimeTaken: &amp;lt;...&amp;gt;&lt;br /&gt;
Type: &amp;lt;...&amp;gt;&lt;br /&gt;
Field: &amp;lt;...&amp;gt;&lt;br /&gt;
OldValue: &amp;lt;...&amp;gt;&lt;br /&gt;
NewValue: &amp;lt;...&amp;gt;&lt;br /&gt;
Data: &amp;lt;...&amp;gt;&lt;br /&gt;
Description: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Content: &amp;lt;lin1-0&amp;gt;&lt;br /&gt;
         &amp;lt;line-1&amp;gt;&lt;br /&gt;
         ...&lt;br /&gt;
         &amp;lt;line-n&amp;gt;&lt;br /&gt;
         &lt;br /&gt;
Creator: &amp;lt;...&amp;gt;&lt;br /&gt;
Created: &amp;lt;...&amp;gt;&lt;br /&gt;
Attachments: &amp;lt;...&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IMPORTANT NOTE: At least with RT 3.8.0, when you request a history item with this method AND you have attached a file that has Mime type text/plain to the same item (eg. a comment with an attachement), RT will return the complete content of the attachment for the key &amp;quot;Content:&amp;quot; and not your real comment that you can see in the web frontend. This may lead to some problems if the requestor does not expect to get a comment content that is for example 1.8 MB of text. With other Mime type attachments this however seems to work. I don&#039;t know if this is a feature or a bug.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &#039;&#039;&#039;Ticket Search&#039;&#039;&#039; ====&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=&amp;amp;lt;query&amp;amp;gt;&amp;amp;orderby=&amp;amp;lt;sort-order&amp;amp;gt;&amp;amp;format=&amp;amp;lt;format&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;query&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use any query generated by the query builder - or feel free to write your own. Here an example that will do the following: Find all tickets that have no owner and the status new or open&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;query= Owner = &#039;Nobody&#039; AND ( Status = &#039;new&#039; OR Status = &#039;open&#039; )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: to get all the tickets in &amp;quot;fooQueue&amp;quot; you&#039;d access:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: to get the tickets for a custom field &amp;quot;Contact Name&amp;quot; you&#039;d access:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=&#039;CF.{Contact Name}&#039;=&#039;Shaun Wallace&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;orderby&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By this parameter you can change the sort field and order of the search result. To sort a list ascending just put a + before the fieldname, otherwise a -. Eg: -Created (will put the newest tickets at the beginning).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;amp;orderby=+Created&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;format&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* i: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;&lt;br /&gt;
* s: &amp;amp;lt;ticket-id&amp;amp;gt;: &amp;amp;lt;ticket-subject&amp;amp;gt;&lt;br /&gt;
* l: a multi-line format&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;amp;orderby=+Created&amp;amp;format=i&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fields&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A list of fields you would like included in the result set.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=id=42&amp;amp;format=l&amp;amp;fields=Subject,Status,Priority,CF.\{Category\}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that you may need to escape characters like the curly braces for CFs.&lt;br /&gt;
&lt;br /&gt;
==== &#039;&#039;&#039;Ticket Create&#039;&#039;&#039; ====&lt;br /&gt;
&lt;br /&gt;
To create a new ticket: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/new&amp;lt;/code&amp;gt; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line, example:&lt;br /&gt;
&lt;br /&gt;
Testing the new ticket section&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: ticket/new&lt;br /&gt;
Queue: &amp;lt;queue name&amp;gt;&lt;br /&gt;
Requestor: &amp;lt;requestor email address&amp;gt;&lt;br /&gt;
Subject: &amp;lt;subject&amp;gt;&lt;br /&gt;
Cc: &amp;lt;...&amp;gt;&lt;br /&gt;
AdminCc: &amp;lt;...&amp;gt;&lt;br /&gt;
Owner: &amp;lt;...&amp;gt;&lt;br /&gt;
Status: &amp;lt;...&amp;gt;&lt;br /&gt;
Priority: &amp;lt;...&amp;gt;&lt;br /&gt;
InitialPriority: &amp;lt;...&amp;gt;&lt;br /&gt;
FinalPriority: &amp;lt;...&amp;gt;&lt;br /&gt;
TimeEstimated: &amp;lt;...&amp;gt;&lt;br /&gt;
Starts: &amp;lt;...&amp;gt;&lt;br /&gt;
Due: &amp;lt;...&amp;gt;&lt;br /&gt;
Text: &amp;lt;The ticket content&amp;gt;&lt;br /&gt;
CF-&amp;lt;CustomFieldName&amp;gt;: &amp;lt;CustomFieldValue&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are any &amp;quot;special&amp;quot; characters (Umlauts, dash, ...?) in a custom field&#039;s name, you can still access it via its ID:&lt;br /&gt;
 CF-$id: &amp;lt;Value&amp;gt;&lt;br /&gt;
If you want to have a multiline Text, prefix every line with a blank.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Due: &amp;lt;...&amp;gt;&lt;br /&gt;
Text: This is &lt;br /&gt;
 a &lt;br /&gt;
 multiline Text&lt;br /&gt;
 !!!&lt;br /&gt;
CF-&amp;lt;CustomFieldName&amp;gt;: &amp;lt;CustomFieldValue&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response should look like: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/4.0.6 200 Ok&lt;br /&gt;
&lt;br /&gt;
# Ticket 775 created.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== curl example =====&lt;br /&gt;
    &lt;br /&gt;
  * Create a file containing the ticket form:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: ticket/new&lt;br /&gt;
Queue: queue1&lt;br /&gt;
Requestor: requestor@email&lt;br /&gt;
Priority: 4&lt;br /&gt;
CF-Type of request: Demande&lt;br /&gt;
Subject: Test REST&lt;br /&gt;
Text: Multi line&lt;br /&gt;
 test with&lt;br /&gt;
 special chars: é&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  * Submit using curl:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
curl --data-urlencode content@file.name &#039;https://HOSTNAME/REST/1.0/ticket/new?user=USER&amp;amp;pass=PASSWORD&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Ticket Edit ====&lt;br /&gt;
To update an existing ticket: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/edit&amp;lt;/code&amp;gt; with a variable named &amp;quot;content&amp;quot;, containing &amp;quot;key: value&amp;quot; line by line (like the one displayed when issuing &amp;lt;code&amp;gt;ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;). Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Priority: 5&lt;br /&gt;
TimeWorked: 15&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*PHP&lt;br /&gt;
   &amp;lt;pre&amp;gt; &lt;br /&gt;
                    $username = rt_user;&lt;br /&gt;
                    $password = rt_pass;&lt;br /&gt;
                    $url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/&amp;lt;ticket id&amp;gt;/edit?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
                    $request = new HttpRequest($url, HTTP_METH_POST);&lt;br /&gt;
                    $post_data=array(&amp;quot;content&amp;quot;=&amp;gt;&amp;quot;AdminCc: userX\nText: This is a REST test edit ticket\n&amp;quot;);&lt;br /&gt;
                    &lt;br /&gt;
                    // add the post fields  &lt;br /&gt;
                    $request-&amp;gt;addPostFields($postData);&lt;br /&gt;
                    // response from RT&lt;br /&gt;
                    $response = $request-&amp;gt;send()-&amp;gt;getBody();&lt;br /&gt;
                    print_r($response);&lt;br /&gt;
                    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tickets History Reply ====&lt;br /&gt;
Same as comment: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/comment&amp;lt;/code&amp;gt; with a variable name &amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
Action: correspond&lt;br /&gt;
Text: the text comment&lt;br /&gt;
Cc: &amp;lt;...&amp;gt;&lt;br /&gt;
Bcc: &amp;lt;...&amp;gt;&lt;br /&gt;
TimeWorked: &amp;lt;...&amp;gt;&lt;br /&gt;
Attachment: an attachment filename/path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Cc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Bcc&amp;lt;/code&amp;gt; are for this reply only (&#039;&#039;I think&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
==== Ticket History Comment ====&lt;br /&gt;
To add a comment to an existing ticket: POST on &amp;quot;&amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/comment&amp;lt;/code&amp;gt;&amp;quot; with a variable name &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
Action: comment&lt;br /&gt;
Text: the text comment&lt;br /&gt;
Attachment: an attachment filename/path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Action can be &amp;quot;&amp;lt;code&amp;gt;comment&amp;lt;/code&amp;gt;&amp;quot; or &amp;quot;&amp;lt;code&amp;gt;correspond&amp;lt;/code&amp;gt;&amp;quot;. For a list of fields you can use in correspondence, try &amp;quot;&amp;lt;code&amp;gt;/opt/rt3/bin/rt correspond ticket/1&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your comment contains multiple lines, each new line must be preceded by a space (e.g. &amp;quot;line 1\n line 2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you want to use HTML replies, use &amp;lt;pre&amp;gt;Content-Type: text/html&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you used &amp;quot;&amp;lt;code&amp;gt;Attachment&amp;lt;/code&amp;gt;&amp;quot;, you must add to your POST a variable &amp;quot;&amp;lt;code&amp;gt;attachment_1&amp;lt;/code&amp;gt;&amp;quot; that contains the raw attachment in multi-part file object.&lt;br /&gt;
&lt;br /&gt;
You can upload more attachments as well, in this case you have to separate the file names in the &amp;quot;&amp;lt;code style=&amp;quot;border-style: initial; border-color: initial; &amp;quot;&amp;gt;Attachment&amp;lt;/code&amp;gt;&amp;quot; with &amp;quot;\n &amp;quot;(a newline and space, without quotes) and add a new variable &amp;quot;attachment_$i&amp;quot; to your POST where $i is the index of attachment.&lt;br /&gt;
&lt;br /&gt;
You need to send header to post comments&lt;br /&gt;
&lt;br /&gt;
==== Ticket Links Edit ====&lt;br /&gt;
To update links on an existing ticket: POST on &amp;quot;&amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&amp;lt;/code&amp;gt;&amp;quot; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line (like the one displayed when issuing &amp;quot;&amp;lt;code&amp;gt;ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&amp;lt;/code&amp;gt;&amp;quot;). Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DependsOn: 54354&lt;br /&gt;
RefersTo: http://some.external/link&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== User Properties ===&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single user.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/user/&amp;amp;lt;user-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.4 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: user/&amp;amp;lt;user-id&amp;amp;gt;&lt;br /&gt;
 Name: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Password: ********&lt;br /&gt;
 EmailAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 RealName: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Organization: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Privileged: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Disabled: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also you can use user login instead of user ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ===&lt;br /&gt;
&lt;br /&gt;
==== User Create ====&lt;br /&gt;
&lt;br /&gt;
To create a new user: post on &amp;lt;code&amp;gt;/REST/1.0/user/new&amp;lt;/code&amp;gt; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line, like the response to &amp;lt;code&amp;gt;/user/&amp;amp;lt;ticket-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== User Edit ====&lt;br /&gt;
To update an existing user: post on &amp;lt;code&amp;gt;/REST/1.0/user/&amp;amp;lt;user-id&amp;amp;gt;/edit&amp;lt;/code&amp;gt; with a variable named &amp;quot;content&amp;quot;, containing &amp;quot;key: value&amp;quot; line by line (like the one displayed when issuing &amp;lt;code&amp;gt;user/&amp;amp;lt;user-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Queue Properties ===&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single queue.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/queue/&amp;amp;lt;queue-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.4 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: queue/&amp;amp;lt;queue-id&amp;amp;gt;&lt;br /&gt;
 Name: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Description: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 CorrespondAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 CommentAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 InitialPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 FinalPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 DefaultDueIn: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Logout ===&lt;br /&gt;
&lt;br /&gt;
To logout: post on &amp;lt;code&amp;gt;/REST/1.0/logout&amp;lt;/code&amp;gt; with empty content.&lt;br /&gt;
&lt;br /&gt;
== Types ==&lt;br /&gt;
&lt;br /&gt;
*new&lt;br /&gt;
*open&lt;br /&gt;
*stalled&lt;br /&gt;
*resolved&lt;br /&gt;
*rejected&lt;br /&gt;
*deleted&lt;br /&gt;
+ other custom values defined in you local RT portal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== History entry type ===&lt;br /&gt;
* Create&lt;br /&gt;
* CustomField&lt;br /&gt;
* EmailRecord&lt;br /&gt;
* Status&lt;br /&gt;
* CommentEmailRecord&lt;br /&gt;
* Correspond&lt;br /&gt;
* Comment&lt;br /&gt;
* Priority&lt;br /&gt;
* Give&lt;br /&gt;
* Steal&lt;br /&gt;
* Take&lt;br /&gt;
* Untake&lt;br /&gt;
* AddWatcher&lt;br /&gt;
* DeleteWatcher&lt;br /&gt;
* AddLink&lt;br /&gt;
* DeleteLink&lt;br /&gt;
* AddReminder&lt;br /&gt;
* OpenReminder&lt;br /&gt;
* ResolveReminder&lt;br /&gt;
* Set&lt;br /&gt;
* Force&lt;br /&gt;
* Subject&lt;br /&gt;
* Told&lt;br /&gt;
* PurgeTransaction&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
=== Data format ===&lt;br /&gt;
History entries time returns in UTC, boolean returns as &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; (true) and &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;(false). &lt;br /&gt;
Use only &amp;lt;code&amp;gt;&amp;quot;\n&amp;quot;&amp;lt;/code&amp;gt;, not &amp;lt;code&amp;gt;&amp;quot;\r\n&amp;quot;&amp;lt;/code&amp;gt;in post content. &lt;br /&gt;
Comments in response body starts with &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
#symbol.&lt;br /&gt;
&lt;br /&gt;
=== Request status ===&lt;br /&gt;
To get real request/post status you need to check status code in first line of server response.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Perl ===&lt;br /&gt;
To get the results of a single request (without setting the Session-Cookie) - assuming you&#039;ve set:&lt;br /&gt;
&lt;br /&gt;
* $uri to your RT REST URL&lt;br /&gt;
* $access_user to your username&lt;br /&gt;
* $access_password to your password&lt;br /&gt;
* $ticketNumber to the ticket you want to see&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
my $ua = LWP::UserAgent-&amp;amp;gt;new;&lt;br /&gt;
$ua-&amp;gt;timeout(10);&lt;br /&gt;
$ua-&amp;gt;agent(&amp;quot;YOURUSERAGENTHERE&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
my $response = $ua-&amp;gt;post($uri.&amp;quot;ticket/$ticketNumber&amp;quot;,&lt;br /&gt;
   [&#039;user&#039; =&amp;gt; $access_user, &#039;pass&#039; =&amp;gt; $access_password],&lt;br /&gt;
    &#039;Content_Type&#039; =&amp;gt; &#039;form-data&#039;);&lt;br /&gt;
&lt;br /&gt;
if ($response-&amp;amp;gt;is_success) {&lt;br /&gt;
   print $response-&amp;gt;decoded_content;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import org.apache.commons.httpclient.HttpClient;&lt;br /&gt;
import org.apache.commons.httpclient.methods.PostMethod;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.Part;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.StringPart;&lt;br /&gt;
  &lt;br /&gt;
public class RtTicketCreator {&lt;br /&gt;
   static final String BASE_URI = &amp;quot;http://rt.xxx.com/REST/1.0&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
   public static void main(String[] args) throws IOException {&lt;br /&gt;
 &lt;br /&gt;
      PostMethod mPost = new PostMethod(BASE_URI + &amp;quot;/ticket/new?user=username&amp;amp;amp;pass=password&amp;quot;);&lt;br /&gt;
      Part[] parts = { new StringPart(&amp;quot;content&amp;quot;, &amp;quot;Queue: General\nSubject: 123&amp;quot;) };&lt;br /&gt;
      mPost.setRequestEntity(new MultipartRequestEntity(parts, mPost.getParams()));&lt;br /&gt;
      HttpClient cl = new HttpClient();&lt;br /&gt;
      cl.executeMethod(mPost);&lt;br /&gt;
      System.out.println(mPost.getResponseBodyAsString());&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Java ( Based on new Apache HttpComponents library ) ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
* RT ticket creator based on the current Apache HttpComponents library 4.1.3&lt;br /&gt;
* Created by Koustubha Kale, kmkale at youtility dot in&lt;br /&gt;
*/&lt;br /&gt;
import org.apache.http.HttpEntity;&lt;br /&gt;
import org.apache.http.HttpResponse;&lt;br /&gt;
import org.apache.http.auth.AuthScope;&lt;br /&gt;
import org.apache.http.auth.UsernamePasswordCredentials;&lt;br /&gt;
import org.apache.http.client.HttpClient;&lt;br /&gt;
import org.apache.http.client.methods.HttpPost;&lt;br /&gt;
import org.apache.http.entity.mime.MultipartEntity;&lt;br /&gt;
import org.apache.http.entity.mime.content.StringBody;&lt;br /&gt;
import org.apache.http.impl.client.DefaultHttpClient;&lt;br /&gt;
import org.apache.http.util.EntityUtils;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class NewApacheHttpcomponentsRtTicketCreator {&lt;br /&gt;
&lt;br /&gt;
    public static void main(String[] args) throws Exception {&lt;br /&gt;
        &lt;br /&gt;
        DefaultHttpClient httpclient = new DefaultHttpClient();&lt;br /&gt;
	try {&lt;br /&gt;
            &lt;br /&gt;
            HttpPost httppost = new HttpPost(&amp;quot;http://rt.xxx.com/rt/REST/1.0&amp;quot; +&lt;br /&gt;
                    &amp;quot;/ticket/new?user=username&amp;amp;pass=password&amp;quot;);&lt;br /&gt;
	    StringBody content = new StringBody(&amp;quot;Queue: General\nSubject: 123&amp;quot;);&lt;br /&gt;
	    MultipartEntity reqEntity = new MultipartEntity();&lt;br /&gt;
	    reqEntity.addPart(&amp;quot;content&amp;quot;, content);&lt;br /&gt;
	    httppost.setEntity(reqEntity);&lt;br /&gt;
	    System.out.println(&amp;quot;executing request &amp;quot; + httppost.getRequestLine());&lt;br /&gt;
            HttpResponse response = httpclient.execute(httppost);&lt;br /&gt;
            HttpEntity resEntity = response.getEntity();&lt;br /&gt;
&lt;br /&gt;
            System.out.println(&amp;quot;----------------------------------------&amp;quot;);&lt;br /&gt;
            System.out.println(response.getStatusLine());&lt;br /&gt;
            if (resEntity != null) {&lt;br /&gt;
                System.out.println(&amp;quot;Response content length: &amp;quot; + resEntity.getContentLength());&lt;br /&gt;
            }&lt;br /&gt;
            EntityUtils.consume(resEntity);&lt;br /&gt;
        } finally {&lt;br /&gt;
            try { httpclient.getConnectionManager().shutdown(); } catch (Exception ignore) {}&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import cookielib&lt;br /&gt;
import urllib&lt;br /&gt;
import urllib2&lt;br /&gt;
       &lt;br /&gt;
# creates a cookie for the rtserver with the credentials given at initialization.&lt;br /&gt;
# define your credentials here&lt;br /&gt;
access_user = &#039;your_login&#039;&lt;br /&gt;
access_password = &#039;your_password&#039;&lt;br /&gt;
       &lt;br /&gt;
# here is the RequestTracker URI we try to access&lt;br /&gt;
uri = &#039;http://your-rt-instance.com/REST/1.0/&#039;&lt;br /&gt;
       &lt;br /&gt;
# trying login on rt server&lt;br /&gt;
cj = cookielib.LWPCookieJar()&lt;br /&gt;
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))&lt;br /&gt;
urllib2.install_opener(opener)&lt;br /&gt;
data = {&#039;user&#039;: access_user, &#039;pass&#039;: access_password}&lt;br /&gt;
ldata = urllib.urlencode(data)&lt;br /&gt;
login = urllib2.Request(uri, ldata)&lt;br /&gt;
try:&lt;br /&gt;
   response = urllib2.urlopen(login)&lt;br /&gt;
   print response.read()&lt;br /&gt;
   print &amp;quot;login successful&amp;quot;&lt;br /&gt;
except urllib2.URLError:&lt;br /&gt;
   # could not connect to server&lt;br /&gt;
   print &amp;quot;Not able to login&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ruby ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env ruby&lt;br /&gt;
require &#039;net/http&#039;&lt;br /&gt;
&lt;br /&gt;
user = &#039;username&#039;&lt;br /&gt;
pass = &#039;password&#039;&lt;br /&gt;
uri = URI(&#039;https://rt.example.com/REST/1.0/ticket/123/show&#039;)&lt;br /&gt;
&lt;br /&gt;
req = Net::HTTP::Post.new(uri.path)&lt;br /&gt;
req.set_form_data(&#039;user&#039; =&amp;gt; user, &#039;pass&#039; =&amp;gt; pass)&lt;br /&gt;
&lt;br /&gt;
res = Net::HTTP.start(uri.hostname, uri.port, &lt;br /&gt;
  :use_ssl =&amp;gt; uri.scheme == &#039;https&#039;, &lt;br /&gt;
  :set_debug_output =&amp;gt; $stderr) do |http|&lt;br /&gt;
  http.request(req)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
case res&lt;br /&gt;
when Net::HTTPSuccess, Net::HTTPRedirection&lt;br /&gt;
  # OK&lt;br /&gt;
  puts &amp;quot;HTTP response code:  #{res.code}&amp;quot;&lt;br /&gt;
  puts &amp;quot;HTTP message: #{res.message}&amp;quot;&lt;br /&gt;
  puts &amp;quot;Response:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  res.each do |key,val|&lt;br /&gt;
    puts &amp;quot;#{key} =&amp;gt; #{val}&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  puts &amp;quot;Data:&amp;quot;&lt;br /&gt;
  puts res.body&lt;br /&gt;
else&lt;br /&gt;
  res.value&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PHP ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$username = rt_user;&lt;br /&gt;
$password = rt_pass;&lt;br /&gt;
$url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/&amp;lt;ticket id&amp;gt;/show?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
$request = new HttpRequest($url, HTTP_METH_GET);&lt;br /&gt;
/* if you want&#039;s to pass additional parameters */&lt;br /&gt;
$request-&amp;gt;addQueryData(array());&lt;br /&gt;
$response = $request-&amp;gt;send();&lt;br /&gt;
print_r($response);&lt;br /&gt;
&amp;lt;/pre&amp;gt; OR&amp;lt;pre&amp;gt;&lt;br /&gt;
$username = rt_user;&lt;br /&gt;
$password = rt_pass;&lt;br /&gt;
$url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/new?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
$request = new HttpRequest($url, HTTP_METH_POST);&lt;br /&gt;
// Note : to add data in custom fields you need to add element like below example&lt;br /&gt;
// in $post_data array&lt;br /&gt;
// Example : \nCF-customfield1:testdata&lt;br /&gt;
$post_data=array(&amp;quot;content&amp;quot;=&amp;gt;&amp;quot;Queue: General\nRequestor: user@domain\nSubject: REST test 1\nOwner: userX\nAdminCc: userX\nText: This is a REST test\n&amp;quot;);&lt;br /&gt;
$request-&amp;gt;addPostFields($post_data);&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
response = $request-&amp;gt;send()-&amp;gt;getBody();&lt;br /&gt;
print_r($response);&lt;br /&gt;
}catch (HttpException $ex) {&lt;br /&gt;
echo $ex;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C# ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Using &amp;quot;WCF REST Starter Kit&amp;quot; (http://msdn.microsoft.com/en-us/netframework/cc950529.aspx)&lt;br /&gt;
using (var client = new HttpClient(&amp;quot;http://rt.site.com/REST/1.0/&amp;quot;))&lt;br /&gt;
{&lt;br /&gt;
   client.TransportSettings.Cookies = new CookieContainer();&lt;br /&gt;
&lt;br /&gt;
   var form = new HttpUrlEncodedForm();&lt;br /&gt;
   form.Add(&amp;quot;user&amp;quot;, &amp;quot;LOGIN&amp;quot;);&lt;br /&gt;
   form.Add(&amp;quot;pass&amp;quot;, &amp;quot;PASSWORD&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
   client.Post(string.Empty, form.CreateHttpContent());&lt;br /&gt;
&lt;br /&gt;
   // 1. Get ticket data&lt;br /&gt;
   using (var request = client.Get(&amp;quot;ticket/1234/show&amp;quot;))&lt;br /&gt;
   {&lt;br /&gt;
      string content = request.Content.ReadAsString();&lt;br /&gt;
      // Some logic&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // 2. Post ticket reply with attachment&lt;br /&gt;
   var formPost = new HttpMultipartMimeForm();&lt;br /&gt;
   byte[] attachment = new byte[];&lt;br /&gt;
   string content = string.Empty;&lt;br /&gt;
         &lt;br /&gt;
   // Store data in attachment&lt;br /&gt;
   // Store data in content string (&amp;quot;Field: Value&amp;quot; line by line)&lt;br /&gt;
   // ...&lt;br /&gt;
         &lt;br /&gt;
   formPost.Add(&amp;quot;content&amp;quot;, content);&lt;br /&gt;
   formPost.Add(&amp;quot;attachment_1&amp;quot;, &amp;quot;attachment_1&amp;quot;, HttpContent.Create(attachment, &amp;quot;application/octet-stream&amp;quot;));&lt;br /&gt;
                             &lt;br /&gt;
   using (var post = client.Post(&amp;quot;ticket/1234/comment&amp;quot;), formPost.CreateHttpContent()))&lt;br /&gt;
      // Some logic&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Powershell (v3)===&lt;br /&gt;
* Escape Powershell reserved chars in user/pass&lt;br /&gt;
* If connecting via SSL, use fqdn of server, not cname&lt;br /&gt;
*Use `n (newline) when composing new ticket structure&lt;br /&gt;
Read RT queue based on query: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$servername=&amp;quot;Your Servername here&amp;quot;&lt;br /&gt;
$u=&amp;quot;user=Username&amp;quot;&lt;br /&gt;
$p=&amp;quot;pass=Password&amp;quot;&lt;br /&gt;
$q=&amp;quot;search/ticket?query=(Status=&#039;open&#039; OR Status=&#039;new&#039;) AND (Queue=&#039;GENERAL&#039; OR Queue=&#039;FOO&#039;) AND Owner=&#039;Nobody&#039;&amp;quot;&lt;br /&gt;
$uri=&amp;quot;https://&amp;quot; + $servername + &amp;quot;/rt/REST/1.0/&amp;quot; + $q + &amp;quot;&amp;amp;&amp;quot; + $u + &amp;quot;&amp;amp;&amp;quot; + $p&lt;br /&gt;
$RT=Invoke-WebRequest -Uri  $uri -SessionVariable sess&lt;br /&gt;
$rt.Content&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===VB.NET===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Public Sub AddAttachmentToRT(ByVal url As String, ByVal fileName As String, ByVal filePath As String)&lt;br /&gt;
&lt;br /&gt;
        Dim dataBoundary As String = &amp;quot;--xYzZY&amp;quot;&lt;br /&gt;
        Dim request As HttpWebRequest&lt;br /&gt;
        Dim fileType As String = &amp;quot;image/jpeg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        &#039;Create a POST web request to the REST interface using the passed URL&lt;br /&gt;
        request = CType(WebRequest.Create(url), HttpWebRequest)&lt;br /&gt;
        request.ContentType = &amp;quot;multipart/form-data; boundary=xYzZY&amp;quot;&lt;br /&gt;
        request.Method = &amp;quot;POST&amp;quot;&lt;br /&gt;
        request.KeepAlive = True&lt;br /&gt;
&lt;br /&gt;
        &#039;Write the request to the requestStream&lt;br /&gt;
        Using requestStream As IO.Stream = request.GetRequestStream()&lt;br /&gt;
&lt;br /&gt;
            &#039;Create a variable &amp;quot;attachment_1&amp;quot; in the POST, specify the file name and file type&lt;br /&gt;
            Dim preAttachment As String = dataBoundary + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Disposition: form-data; name=&amp;quot;&amp;quot;attachment_1&amp;quot;&amp;quot;; filename=&amp;quot;&amp;quot;&amp;quot; + fileName + &amp;quot;&amp;quot;&amp;quot;&amp;quot; + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Type: &amp;quot; + fileType + vbCrLf _&lt;br /&gt;
            + vbCrLf&lt;br /&gt;
&lt;br /&gt;
            &#039;Convert this preAttachment string to bytes&lt;br /&gt;
            Dim preAttachmentBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(preAttachment)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write this preAttachment string to the stream&lt;br /&gt;
            requestStream.Write(preAttachmentBytes, 0, preAttachmentBytes.Length)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write the file as bytes to the stream by passing its exact location&lt;br /&gt;
            Using fileStream As New IO.FileStream(Server.MapPath(filePath + fileName), IO.FileMode.Open, IO.FileAccess.Read)&lt;br /&gt;
&lt;br /&gt;
                Dim buffer(4096) As Byte&lt;br /&gt;
                Dim bytesRead As Int32 = fileStream.Read(buffer, 0, buffer.Length)&lt;br /&gt;
&lt;br /&gt;
                Do While (bytesRead &amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
                    requestStream.Write(buffer, 0, bytesRead)&lt;br /&gt;
                    bytesRead = fileStream.Read(buffer, 0, buffer.Length)&lt;br /&gt;
&lt;br /&gt;
                Loop&lt;br /&gt;
&lt;br /&gt;
            End Using&lt;br /&gt;
&lt;br /&gt;
            &#039;Create a variable named content in the POST, specify the attachment name and comment text&lt;br /&gt;
            Dim postAttachment As String = vbCrLf _&lt;br /&gt;
            + dataBoundary + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Disposition: form-data; name=&amp;quot;&amp;quot;content&amp;quot;&amp;quot;&amp;quot; + vbCrLf _&lt;br /&gt;
            + vbCrLf _&lt;br /&gt;
            + &amp;quot;Action: comment&amp;quot; + vbLf _&lt;br /&gt;
            + &amp;quot;Attachment: &amp;quot; + fileName + vbCrLf _&lt;br /&gt;
            + &amp;quot;Text: Whatever You Want&amp;quot; + vbCrLf _&lt;br /&gt;
            + vbCrLf _&lt;br /&gt;
            + &amp;quot;--xYzZY--&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            &#039;Convert postAttachment string to bytes&lt;br /&gt;
            Dim postAttachmentBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(postAttachment)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write the postAttachment string to the stream&lt;br /&gt;
            requestStream.Write(postAttachmentBytes, 0, postAttachmentBytes.Length)&lt;br /&gt;
&lt;br /&gt;
        End Using&lt;br /&gt;
&lt;br /&gt;
        Dim response As Net.WebResponse = Nothing&lt;br /&gt;
&lt;br /&gt;
        &#039;Get the response from our REST request to RT&lt;br /&gt;
        &#039;Required to capture response, without this Try-Catch attaching will fail&lt;br /&gt;
        Try&lt;br /&gt;
            response = request.GetResponse()&lt;br /&gt;
&lt;br /&gt;
            Using responseStream As IO.Stream = response.GetResponseStream()&lt;br /&gt;
&lt;br /&gt;
                Using responseReader As New IO.StreamReader(responseStream)&lt;br /&gt;
&lt;br /&gt;
                    Dim responseText = responseReader.ReadToEnd()&lt;br /&gt;
&lt;br /&gt;
                End Using&lt;br /&gt;
&lt;br /&gt;
            End Using&lt;br /&gt;
&lt;br /&gt;
        Catch exception As Net.WebException&lt;br /&gt;
&lt;br /&gt;
            response = exception.Response&lt;br /&gt;
&lt;br /&gt;
            If (response IsNot Nothing) Then&lt;br /&gt;
&lt;br /&gt;
                Using reader As New IO.StreamReader(response.GetResponseStream())&lt;br /&gt;
&lt;br /&gt;
                    Dim responseText = reader.ReadToEnd()&lt;br /&gt;
&lt;br /&gt;
                End Using&lt;br /&gt;
&lt;br /&gt;
                response.Close()&lt;br /&gt;
&lt;br /&gt;
            End If&lt;br /&gt;
&lt;br /&gt;
        Finally&lt;br /&gt;
&lt;br /&gt;
            request = Nothing&lt;br /&gt;
&lt;br /&gt;
        End Try&lt;br /&gt;
&lt;br /&gt;
    End Sub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===JavaScript===&lt;br /&gt;
This is an example of updating the RefersTo field for a ticket. Assuming Zepto/jQuery is also being used.&lt;br /&gt;
 function link_back(url, ticket_num, rt) {&lt;br /&gt;
     var data, link;&lt;br /&gt;
     link = &amp;quot;refersto: &amp;quot; + url;&lt;br /&gt;
     data = {&amp;quot;content&amp;quot;: link};&lt;br /&gt;
 &lt;br /&gt;
     $.ajax({&lt;br /&gt;
         type: &amp;quot;POST&amp;quot;,&lt;br /&gt;
         url: rt + ticket_num + &amp;quot;/links&amp;quot;,&lt;br /&gt;
         data: data,&lt;br /&gt;
         success: function (reply) {&lt;br /&gt;
             console.log(reply);&lt;br /&gt;
         }&lt;br /&gt;
     });&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 var url = &amp;quot;https://www.wikipedia.org/&amp;quot;;&lt;br /&gt;
 var ticket_num = &amp;quot;123456&amp;quot;;&lt;br /&gt;
 var rt = &amp;quot;https://some.rt.url/REST/1.0/ticket/&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 link_back(url, ticket_num, rt);&lt;br /&gt;
&lt;br /&gt;
== Convenience libraries ==&lt;br /&gt;
&lt;br /&gt;
There are libraries which do much of the low-level work shown in the examples below for you, and provide an easier programming interface for dealing with RT:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Language&lt;br /&gt;
!Package/Module&lt;br /&gt;
!Source&lt;br /&gt;
!Example&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Perl&#039;&#039;&#039;&lt;br /&gt;
|[http://metacpan.org/module/RT::Client::REST RT::Client::REST]&lt;br /&gt;
|[http://rt-client-rest.googlecode.com/svn/trunk/ Google Code]&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;quot;perl -MCPAN -e install RT::Client::REST&amp;quot;&amp;lt;/code&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Ruby&#039;&#039;&#039;&lt;br /&gt;
|[http://rt-client.rubyforge.org RT-Client]&lt;br /&gt;
|[http://rubygems.org/gems/rt-client RubyGems]&lt;br /&gt;
|&amp;lt;code&amp;gt;gem install rt-client&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Ruby&#039;&#039;&#039;&lt;br /&gt;
|[http://rubygems.org/gems/roart Roart]&lt;br /&gt;
|[https://github.com/pjdavis/roart GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;gem install roart&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/z4r/python-rtkit rtkit]&lt;br /&gt;
|[https://github.com/z4r/python-rtkit GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;pip install python-rtkit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/CZ-NIC/python-rt python-rt]&lt;br /&gt;
|[https://github.com/CZ-NIC/python-rt Github]&lt;br /&gt;
|&amp;lt;code&amp;gt;pip install rt&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Java&#039;&#039;&#039;&lt;br /&gt;
|[http://projects.boksa.de/RT-REST/ RT-REST]&lt;br /&gt;
|[https://github.com/bboksa/RT-REST GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;N/A&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;PHP&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/dersam/RTPHPLib RTPHPLib]&lt;br /&gt;
|[https://github.com/dersam/RTPHPLib GitHub]&lt;br /&gt;
|composer require dersam/rt-php-lib&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=RT3BatchAddUsers&amp;diff=26496</id>
		<title>RT3BatchAddUsers</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=RT3BatchAddUsers&amp;diff=26496"/>
		<updated>2017-03-21T19:19:50Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;perl&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
 #!/usr/bin/perl -w&lt;br /&gt;
 #&lt;br /&gt;
 # rtadduser: Batch add local users to RT based on a csv file named users_data.csv located # in the same directory&lt;br /&gt;
 # Mohamed El Erian &amp;amp;lt;mohamed.elerian@britishcouncil.org.eg,melerian@gmail.com&amp;amp;gt;&lt;br /&gt;
 # Partly based on script provided by David Maze &amp;amp;lt;dmaze@cag.lcs.mit.edu&amp;amp;gt;&lt;br /&gt;
 # File format is username,realname,email_address,organization,address1,city,country&lt;br /&gt;
 # $Id$&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
 use lib &amp;quot;/usr/lib&amp;quot;;&lt;br /&gt;
 use strict;&lt;br /&gt;
 use English;&lt;br /&gt;
 use RT::Interface::CLI qw(CleanEnv);&lt;br /&gt;
 use RT::User;&lt;br /&gt;
 &lt;br /&gt;
 CleanEnv();&lt;br /&gt;
 RT::LoadConfig();&lt;br /&gt;
 RT::Init();&lt;br /&gt;
 my @raw_data;&lt;br /&gt;
 my $bc_user = &#039;&#039;;&lt;br /&gt;
 my $username = &#039;&#039;;&lt;br /&gt;
 my $realname = &#039;&#039;;&lt;br /&gt;
 my $email_address = &#039;&#039;;&lt;br /&gt;
 my $organization = &#039;&#039;;&lt;br /&gt;
 my $address1 = &#039;&#039;;&lt;br /&gt;
 my $city = &#039;&#039;;&lt;br /&gt;
 my $country = &#039;&#039;;&lt;br /&gt;
 &lt;br /&gt;
 open(USERS_DATA, &amp;quot;./users_data.csv&amp;quot;) || die(&amp;quot;Could not open file!&amp;quot;);&lt;br /&gt;
 @raw_data=&amp;lt;USERS_DATA&amp;gt;;&lt;br /&gt;
 close(USERS_DATA);&lt;br /&gt;
 foreach $bc_user (@raw_data)&lt;br /&gt;
 {&lt;br /&gt;
  chop($bc_user);&lt;br /&gt;
  ($username,$realname,$email_address,$organization,$address1,$city,$country)=split(/\,/,$bc_user);&lt;br /&gt;
 &lt;br /&gt;
 my $UserObj = new RT::User(RT::SystemUser);&lt;br /&gt;
 $UserObj-&amp;amp;gt;Create(Name =&amp;gt; $username,&lt;br /&gt;
 		 RealName =&amp;gt; $realname,&lt;br /&gt;
                 EmailAddress =&amp;gt; $email_address,&lt;br /&gt;
                 Password =&amp;gt; &#039;Passw0rd&#039;,&lt;br /&gt;
 		 Organization =&amp;gt; $organization,&lt;br /&gt;
 		 Address1 =&amp;gt; $address1,&lt;br /&gt;
 		 City =&amp;gt; $city,&lt;br /&gt;
 		 Country =&amp;gt; $country,&lt;br /&gt;
 		 Privileged =&amp;gt; 1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=RT3BatchAddUsers&amp;diff=26495</id>
		<title>RT3BatchAddUsers</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=RT3BatchAddUsers&amp;diff=26495"/>
		<updated>2017-03-21T19:15:33Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;perl&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
 #!/usr/bin/perl -w&lt;br /&gt;
 #&lt;br /&gt;
 # rtadduser: Batch add local users to RT based on a csv file named users_data.csv located # in the same directory&lt;br /&gt;
 # Mohamed El Erian &amp;amp;lt;mohamed.elerian@britishcouncil.org.eg,melerian@gmail.com&amp;amp;gt;&lt;br /&gt;
 # Partly based on script provided by David Maze &amp;amp;lt;dmaze@cag.lcs.mit.edu&amp;amp;gt;&lt;br /&gt;
 # File format is username,realname,email_address,organization,address1,city,country&lt;br /&gt;
 # $Id$&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
 use lib &amp;quot;/usr/lib&amp;quot;;&lt;br /&gt;
 use strict;&lt;br /&gt;
 use English;&lt;br /&gt;
 use RT::Interface::CLI qw(CleanEnv);&lt;br /&gt;
 use RT::User;&lt;br /&gt;
 &lt;br /&gt;
 CleanEnv();&lt;br /&gt;
 RT::LoadConfig();&lt;br /&gt;
 RT::Init();&lt;br /&gt;
 my @raw_data;&lt;br /&gt;
 my $bc_user = &#039;&#039;;&lt;br /&gt;
 my $username = &#039;&#039;;&lt;br /&gt;
 my $realname = &#039;&#039;;&lt;br /&gt;
 my $email_address = &#039;&#039;;&lt;br /&gt;
 my $organization = &#039;&#039;;&lt;br /&gt;
 my $address1 = &#039;&#039;;&lt;br /&gt;
 my $city = &#039;&#039;;&lt;br /&gt;
 my $country = &#039;&#039;;&lt;br /&gt;
 &lt;br /&gt;
 open(USERS_DATA, &amp;quot;./users_data.csv&amp;quot;) || die(&amp;quot;Could not open file!&amp;quot;);&lt;br /&gt;
 @raw_data=&amp;lt;USERS_DATA&amp;gt;;&lt;br /&gt;
 close(USERS_DATA);&lt;br /&gt;
 foreach $bc_user (@raw_data)&lt;br /&gt;
 {&lt;br /&gt;
  chop($bc_user);&lt;br /&gt;
  ($username,$realname,$email_address,$organization,$address1,$city,$country)=split(/\,/,$bc_user);&lt;br /&gt;
 &lt;br /&gt;
 my $UserObj = new RT::User(RT::SystemUser);&lt;br /&gt;
 $UserObj-&amp;amp;gt;Create(Name =&amp;gt; $username,&lt;br /&gt;
 		 RealName =&amp;gt; $realname,&lt;br /&gt;
                  EmailAddress =&amp;gt; $email_address,&lt;br /&gt;
                  Password =&amp;gt; &#039;Passw0rd&#039;,&lt;br /&gt;
 		 Organization =&amp;gt; $organization,&lt;br /&gt;
 		 Address1 =&amp;gt; $address1,&lt;br /&gt;
 		 City =&amp;gt; $city,&lt;br /&gt;
 		 Country =&amp;gt; $country,&lt;br /&gt;
 		 Privileged =&amp;gt; 1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=REST&amp;diff=26493</id>
		<title>REST</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=REST&amp;diff=26493"/>
		<updated>2017-03-07T13:42:00Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: /* Ticket Search */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
&lt;br /&gt;
The REST Interface gives you access to your RT Database. The complete communication is encapsulated in the HTTP protocol. The interface should be accessible in your installation.&lt;br /&gt;
&lt;br /&gt;
Though you may see references to older 3.x releases of RT below, Best Practice indicates that the REST stuff has not changed in any significant way in 4.x as of, at least, 1/2012.&lt;br /&gt;
&lt;br /&gt;
[{{SERVER}}/index.php?search={{TALKPAGENAME}}&amp;amp;title=Special:Search Legacy Comments] are available from the previous Wikia instance.&lt;br /&gt;
&lt;br /&gt;
== Interface ==&lt;br /&gt;
&lt;br /&gt;
Base URL: &amp;lt;code&amp;gt;.../REST/1.0/&amp;lt;/code&amp;gt;. The default response should be:&lt;br /&gt;
&lt;br /&gt;
    RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
    # Invalid object specification: &#039;index.html&#039;&lt;br /&gt;
&lt;br /&gt;
    id: index.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
The REST Interface does not support HTTP-Authentication. So you must get a valid Session-Token and submit the cookie each request. You usually get a Session-Cookie by submitting the default login form. Use variables &amp;quot;&amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt;&amp;quot; for login and &amp;quot;&amp;lt;code&amp;gt;pass&amp;lt;/code&amp;gt;&amp;quot; for password values. wget doesn&#039;t escape any characters in the --post-data option so make sure you properly escape any special characters in the password.&lt;br /&gt;
&lt;br /&gt;
See the wget invocation line below:&lt;br /&gt;
&lt;br /&gt;
    wget  --keep-session-cookies \&lt;br /&gt;
    --save-cookies cookies.txt \&lt;br /&gt;
    --post-data &#039;user=UUUU&amp;amp;pass=PPPP&#039; \&lt;br /&gt;
    http://my.rt.server&lt;br /&gt;
&lt;br /&gt;
You need the -keep-session-cookies option to make wget save session cookies.&lt;br /&gt;
&lt;br /&gt;
=== Ticket ===&lt;br /&gt;
&lt;br /&gt;
==== Ticket Properties ====&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single ticket, not including the history and comments.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.4.5 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;&lt;br /&gt;
 Queue: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Owner: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Creator: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Subject: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Status: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Priority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 InitialPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 FinalPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Requestors: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Cc: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 AdminCc: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Created: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Starts: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Started: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Due: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Resolved: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Told: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeEstimated: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeWorked: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeLeft: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Links ====&lt;br /&gt;
&lt;br /&gt;
Gets the ticket links for a single ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links/show&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.2 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&lt;br /&gt;
 HasMember: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 ReferredToBy: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 DependedOnBy: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 MemberOf: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 RefersTo: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 DependsOn: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachments ====&lt;br /&gt;
&lt;br /&gt;
Gets a list of all attachments related to the ticket&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachment ====&lt;br /&gt;
Gets the metadata and content of a specific attachment.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments/&amp;amp;lt;attachment-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.8.0 200 Ok&lt;br /&gt;
 &lt;br /&gt;
id: &amp;lt;attachment-id&amp;gt;&lt;br /&gt;
Subject:&lt;br /&gt;
Creator: &amp;lt;user-id&amp;gt;&lt;br /&gt;
Created: &amp;lt;timestamp&amp;gt;&lt;br /&gt;
Transaction: &amp;lt;transaction-id&amp;gt;&lt;br /&gt;
Parent: &amp;lt;parent-id&amp;gt;&lt;br /&gt;
MessageId:&lt;br /&gt;
Filename: &amp;lt;filename&amp;gt;&lt;br /&gt;
ContentType: application/octet-stream&lt;br /&gt;
ContentEncoding: none&lt;br /&gt;
 &lt;br /&gt;
Headers: MIME-Version: 1.0&lt;br /&gt;
         X-Mailer: MIME-tools 5.427 (Entity 5.427)&lt;br /&gt;
         Content-Type: application/octet-stream;&lt;br /&gt;
           name=&amp;quot;&amp;lt;filename&amp;gt;&amp;quot;&lt;br /&gt;
         Content-Disposition: inline; filename=&amp;quot;&amp;lt;filename&amp;gt;&amp;quot;&lt;br /&gt;
         Content-Transfer-Encoding: base64&lt;br /&gt;
         Content-Length: &amp;lt;length in bytes&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Content: ...&lt;br /&gt;
         ...&lt;br /&gt;
         ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE: RT returns the content indented with 9 spaces on each line, so that it lines up with the &amp;quot;Content:&amp;quot; header. Even if you strip this out with a regexp, the content is still UTF-8, which is probably not what you want. To get the original binary data back, strip out the 9 spaces with a regexp, strip off the 3 carriage returns at the end, and then convert the whole thing from UTF-8 to the native character encoding of the attachment, whatever that is. RT doesn&#039;t tell you, so you have know. If the attachments were uploaded by a U.S. Windows system, odds are that Windows-1252 is what you want. If you can&#039;t get the binary back intact, see the next method below.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachment Content ====&lt;br /&gt;
&lt;br /&gt;
Gets the attachment data content without additional metadata or whitespace characters&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments/&amp;amp;lt;attachment-id&amp;amp;gt;/content&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.0 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
So to get the original content you still have to strip the first 2 lines of the response.&lt;br /&gt;
&lt;br /&gt;
==== Ticket History ====&lt;br /&gt;
Gets a list of all the history items for a given ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;history-count&amp;gt;/&amp;lt;history-count&amp;gt; (/total)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;history-id&amp;gt;: &amp;lt;history-name&amp;gt;&lt;br /&gt;
&amp;lt;history-id&amp;gt;: &amp;lt;history-name&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get an additional row, for each history entry found. The first entry is usually: &amp;quot;&amp;lt;code&amp;gt;Ticket created by ...&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
There are two ways to get history item detail: you can do one of these and then recursively perform &amp;lt;code&amp;gt;ticket/history/id/&amp;amp;lt;history-id&amp;amp;gt;&amp;lt;/code&amp;gt; for each history-id from this REST call, but that is extremely wasteful and will scale horribly. What you really want to do is one REST call but get the long format:&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history?format=l&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.8.2 200 Ok&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;n&amp;gt;/&amp;lt;n&amp;gt; (id/&amp;amp;lt;history-id&amp;amp;gt;/total)&lt;br /&gt;
&lt;br /&gt;
id: &amp;lt;history-id&amp;gt;&lt;br /&gt;
Ticket: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
TimeTaken: &amp;lt;...&amp;gt;&lt;br /&gt;
Type: &amp;lt;...&amp;gt;&lt;br /&gt;
Field: &amp;lt;...&amp;gt;&lt;br /&gt;
OldValue: &amp;lt;...&amp;gt;&lt;br /&gt;
NewValue: &amp;lt;...&amp;gt;&lt;br /&gt;
Data: &amp;lt;...&amp;gt;&lt;br /&gt;
Description: &amp;lt;...&amp;gt;&lt;br /&gt;
Content: &amp;lt;...&amp;gt;&lt;br /&gt;
Creator: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Created: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attachments:&lt;br /&gt;
             &amp;lt;attachment-id&amp;gt;: &amp;lt;filename&amp;gt; (&amp;lt;size&amp;gt;)&lt;br /&gt;
             &amp;lt;attachment-id&amp;gt;: &amp;lt;filename&amp;gt; (&amp;lt;size&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;n&amp;gt;/&amp;lt;n&amp;gt; (id/&amp;amp;lt;history-id&amp;amp;gt;/total)&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE: the double dash &amp;quot;--&amp;quot; will occur in the long format between each history item. You can split the output on &amp;quot;--&amp;quot; and iterate over it, parsing out the data with an RFC822 parser, such as an email handling library.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Ticket History Entry ====&lt;br /&gt;
Gets the history information for a single history item. Note that the history item must actually correspond to the ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history/id/&amp;amp;lt;history-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
# 70/70 (id/114856/total)&lt;br /&gt;
&lt;br /&gt;
id: &amp;lt;history-id&amp;gt;&lt;br /&gt;
Ticket: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
TimeTaken: &amp;lt;...&amp;gt;&lt;br /&gt;
Type: &amp;lt;...&amp;gt;&lt;br /&gt;
Field: &amp;lt;...&amp;gt;&lt;br /&gt;
OldValue: &amp;lt;...&amp;gt;&lt;br /&gt;
NewValue: &amp;lt;...&amp;gt;&lt;br /&gt;
Data: &amp;lt;...&amp;gt;&lt;br /&gt;
Description: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Content: &amp;lt;lin1-0&amp;gt;&lt;br /&gt;
         &amp;lt;line-1&amp;gt;&lt;br /&gt;
         ...&lt;br /&gt;
         &amp;lt;line-n&amp;gt;&lt;br /&gt;
         &lt;br /&gt;
Creator: &amp;lt;...&amp;gt;&lt;br /&gt;
Created: &amp;lt;...&amp;gt;&lt;br /&gt;
Attachments: &amp;lt;...&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IMPORTANT NOTE: At least with RT 3.8.0, when you request a history item with this method AND you have attached a file that has Mime type text/plain to the same item (eg. a comment with an attachement), RT will return the complete content of the attachment for the key &amp;quot;Content:&amp;quot; and not your real comment that you can see in the web frontend. This may lead to some problems if the requestor does not expect to get a comment content that is for example 1.8 MB of text. With other Mime type attachments this however seems to work. I don&#039;t know if this is a feature or a bug.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &#039;&#039;&#039;Ticket Search&#039;&#039;&#039; ====&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=&amp;amp;lt;query&amp;amp;gt;&amp;amp;orderby=&amp;amp;lt;sort-order&amp;amp;gt;&amp;amp;format=&amp;amp;lt;format&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;query&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use any query generated by the query builder - or feel free to write your own. Here an example that will do the following: Find all tickets that have no owner and the status new or open&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;query= Owner = &#039;Nobody&#039; AND ( Status = &#039;new&#039; OR Status = &#039;open&#039; )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: to get all the tickets in &amp;quot;fooQueue&amp;quot; you&#039;d access:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: to get the tickets for a custom field &amp;quot;Contact Name&amp;quot; you&#039;d access:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=&#039;CF.{Contact Name}&#039;=&#039;Shaun Wallace&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;orderby&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By this parameter you can change the sort field and order of the search result. To sort a list ascending just put a + before the fieldname, otherwise a -. Eg: -Created (will put the newest tickets at the beginning).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;amp;orderby=+Created&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;format&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* i: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;&lt;br /&gt;
* s: &amp;amp;lt;ticket-id&amp;amp;gt;: &amp;amp;lt;ticket-subject&amp;amp;gt;&lt;br /&gt;
* l: a multi-line format&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;amp;orderby=+Created&amp;amp;format=i&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;fields&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A list of fields you would like included in the result set.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=id=42&amp;amp;format=l&amp;amp;fields=Subject,Status,Priority,CF.\{Category\}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that you may need to escape characters like the curly braces for CFs.&lt;br /&gt;
&lt;br /&gt;
==== &#039;&#039;&#039;Ticket Create&#039;&#039;&#039; ====&lt;br /&gt;
&lt;br /&gt;
To create a new ticket: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/new&amp;lt;/code&amp;gt; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line, example:&lt;br /&gt;
&lt;br /&gt;
Testing the new ticket section&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: ticket/new&lt;br /&gt;
Queue: &amp;lt;queue name&amp;gt;&lt;br /&gt;
Requestor: &amp;lt;requestor email address&amp;gt;&lt;br /&gt;
Subject: &amp;lt;subject&amp;gt;&lt;br /&gt;
Cc: &amp;lt;...&amp;gt;&lt;br /&gt;
AdminCc: &amp;lt;...&amp;gt;&lt;br /&gt;
Owner: &amp;lt;...&amp;gt;&lt;br /&gt;
Status: &amp;lt;...&amp;gt;&lt;br /&gt;
Priority: &amp;lt;...&amp;gt;&lt;br /&gt;
InitialPriority: &amp;lt;...&amp;gt;&lt;br /&gt;
FinalPriority: &amp;lt;...&amp;gt;&lt;br /&gt;
TimeEstimated: &amp;lt;...&amp;gt;&lt;br /&gt;
Starts: &amp;lt;...&amp;gt;&lt;br /&gt;
Due: &amp;lt;...&amp;gt;&lt;br /&gt;
Text: &amp;lt;The ticket content&amp;gt;&lt;br /&gt;
CF-&amp;lt;CustomFieldName&amp;gt;: &amp;lt;CustomFieldValue&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are any &amp;quot;special&amp;quot; characters (Umlauts, dash, ...?) in a custom field&#039;s name, you can still access it via its ID:&lt;br /&gt;
 CF-$id: &amp;lt;Value&amp;gt;&lt;br /&gt;
If you want to have a multiline Text, prefix every line with a blank.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Due: &amp;lt;...&amp;gt;&lt;br /&gt;
Text: This is &lt;br /&gt;
 a &lt;br /&gt;
 multiline Text&lt;br /&gt;
 !!!&lt;br /&gt;
CF-&amp;lt;CustomFieldName&amp;gt;: &amp;lt;CustomFieldValue&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response should look like: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/4.0.6 200 Ok&lt;br /&gt;
&lt;br /&gt;
# Ticket 775 created.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== curl example =====&lt;br /&gt;
    &lt;br /&gt;
  * Create a file containing the ticket form:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: ticket/new&lt;br /&gt;
Queue: queue1&lt;br /&gt;
Requestor: requestor@email&lt;br /&gt;
Priority: 4&lt;br /&gt;
CF-Type of request: Demande&lt;br /&gt;
Subject: Test REST&lt;br /&gt;
Text: Multi line&lt;br /&gt;
 test with&lt;br /&gt;
 special chars: é&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  * Submit using curl:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
curl --data-urlencode content@file.name &#039;https://HOSTNAME/REST/1.0/ticket/new?user=USER&amp;amp;pass=PASSWORD&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Ticket Edit ====&lt;br /&gt;
To update an existing ticket: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/edit&amp;lt;/code&amp;gt; with a variable named &amp;quot;content&amp;quot;, containing &amp;quot;key: value&amp;quot; line by line (like the one displayed when issuing &amp;lt;code&amp;gt;ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;). Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Priority: 5&lt;br /&gt;
TimeWorked: 15&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*PHP&lt;br /&gt;
   &amp;lt;pre&amp;gt; &lt;br /&gt;
                    $username = rt_user;&lt;br /&gt;
                    $password = rt_pass;&lt;br /&gt;
                    $url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/&amp;lt;ticket id&amp;gt;/edit?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
                    $request = new HttpRequest($url, HTTP_METH_POST);&lt;br /&gt;
                    $post_data=array(&amp;quot;content&amp;quot;=&amp;gt;&amp;quot;AdminCc: userX\nText: This is a REST test edit ticket\n&amp;quot;);&lt;br /&gt;
                    &lt;br /&gt;
                    // add the post fields  &lt;br /&gt;
                    $request-&amp;gt;addPostFields($postData);&lt;br /&gt;
                    // response from RT&lt;br /&gt;
                    $response = $request-&amp;gt;send()-&amp;gt;getBody();&lt;br /&gt;
                    print_r($response);&lt;br /&gt;
                    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tickets History Reply ====&lt;br /&gt;
Same as comment: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/comment&amp;lt;/code&amp;gt; with a variable name &amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
Action: correspond&lt;br /&gt;
Text: the text comment&lt;br /&gt;
Cc: &amp;lt;...&amp;gt;&lt;br /&gt;
Bcc: &amp;lt;...&amp;gt;&lt;br /&gt;
TimeWorked: &amp;lt;...&amp;gt;&lt;br /&gt;
Attachment: an attachment filename/path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Cc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Bcc&amp;lt;/code&amp;gt; are for this reply only (&#039;&#039;I think&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
==== Ticket History Comment ====&lt;br /&gt;
To add a comment to an existing ticket: POST on &amp;quot;&amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/comment&amp;lt;/code&amp;gt;&amp;quot; with a variable name &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
Action: comment&lt;br /&gt;
Text: the text comment&lt;br /&gt;
Attachment: an attachment filename/path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Action can be &amp;quot;&amp;lt;code&amp;gt;comment&amp;lt;/code&amp;gt;&amp;quot; or &amp;quot;&amp;lt;code&amp;gt;correspond&amp;lt;/code&amp;gt;&amp;quot;. For a list of fields you can use in correspondence, try &amp;quot;&amp;lt;code&amp;gt;/opt/rt3/bin/rt correspond ticket/1&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your comment contains multiple lines, each new line must be preceded by a space (e.g. &amp;quot;line 1\n line 2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you want to use HTML replies, use &amp;lt;pre&amp;gt;Content-Type: text/html&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you used &amp;quot;&amp;lt;code&amp;gt;Attachment&amp;lt;/code&amp;gt;&amp;quot;, you must add to your POST a variable &amp;quot;&amp;lt;code&amp;gt;attachment_1&amp;lt;/code&amp;gt;&amp;quot; that contains the raw attachment in multi-part file object.&lt;br /&gt;
&lt;br /&gt;
You can upload more attachments as well, in this case you have to separate the file names in the &amp;quot;&amp;lt;code style=&amp;quot;border-style: initial; border-color: initial; &amp;quot;&amp;gt;Attachment&amp;lt;/code&amp;gt;&amp;quot; with &amp;quot;\n &amp;quot;(a newline and space, without quotes) and add a new variable &amp;quot;attachment_$i&amp;quot; to your POST where $i is the index of attachment.&lt;br /&gt;
&lt;br /&gt;
You need to send header to post comments&lt;br /&gt;
&lt;br /&gt;
==== Ticket Links Edit ====&lt;br /&gt;
To update links on an existing ticket: POST on &amp;quot;&amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&amp;lt;/code&amp;gt;&amp;quot; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line (like the one displayed when issuing &amp;quot;&amp;lt;code&amp;gt;ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&amp;lt;/code&amp;gt;&amp;quot;). Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DependsOn: 54354&lt;br /&gt;
RefersTo: http://some.external/link&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== User Properties ===&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single user.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/user/&amp;amp;lt;user-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.4 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: user/&amp;amp;lt;user-id&amp;amp;gt;&lt;br /&gt;
 Name: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Password: ********&lt;br /&gt;
 EmailAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 RealName: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Organization: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Privileged: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Disabled: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also you can use user login instead of user ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ===&lt;br /&gt;
&lt;br /&gt;
==== User Create ====&lt;br /&gt;
&lt;br /&gt;
To create a new user: post on &amp;lt;code&amp;gt;/REST/1.0/user/new&amp;lt;/code&amp;gt; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line, like the response to &amp;lt;code&amp;gt;/user/&amp;amp;lt;ticket-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== User Edit ====&lt;br /&gt;
To update an existing user: post on &amp;lt;code&amp;gt;/REST/1.0/user/&amp;amp;lt;user-id&amp;amp;gt;/edit&amp;lt;/code&amp;gt; with a variable named &amp;quot;content&amp;quot;, containing &amp;quot;key: value&amp;quot; line by line (like the one displayed when issuing &amp;lt;code&amp;gt;user/&amp;amp;lt;user-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Queue Properties ===&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single queue.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/queue/&amp;amp;lt;queue-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.4 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: queue/&amp;amp;lt;queue-id&amp;amp;gt;&lt;br /&gt;
 Name: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Description: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 CorrespondAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 CommentAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 InitialPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 FinalPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 DefaultDueIn: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Logout ===&lt;br /&gt;
&lt;br /&gt;
To logout: post on &amp;lt;code&amp;gt;/REST/1.0/logout&amp;lt;/code&amp;gt; with empty content.&lt;br /&gt;
&lt;br /&gt;
== Types ==&lt;br /&gt;
&lt;br /&gt;
*new&lt;br /&gt;
*open&lt;br /&gt;
*stalled&lt;br /&gt;
*resolved&lt;br /&gt;
*rejected&lt;br /&gt;
*deleted&lt;br /&gt;
+ other custom values defined in you local RT portal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== History entry type ===&lt;br /&gt;
* Create&lt;br /&gt;
* CustomField&lt;br /&gt;
* EmailRecord&lt;br /&gt;
* Status&lt;br /&gt;
* CommentEmailRecord&lt;br /&gt;
* Correspond&lt;br /&gt;
* Comment&lt;br /&gt;
* Priority&lt;br /&gt;
* Give&lt;br /&gt;
* Steal&lt;br /&gt;
* Take&lt;br /&gt;
* Untake&lt;br /&gt;
* AddWatcher&lt;br /&gt;
* DeleteWatcher&lt;br /&gt;
* AddLink&lt;br /&gt;
* DeleteLink&lt;br /&gt;
* AddReminder&lt;br /&gt;
* OpenReminder&lt;br /&gt;
* ResolveReminder&lt;br /&gt;
* Set&lt;br /&gt;
* Force&lt;br /&gt;
* Subject&lt;br /&gt;
* Told&lt;br /&gt;
* PurgeTransaction&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
=== Data format ===&lt;br /&gt;
History entries time returns in UTC, boolean returns as &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; (true) and &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;(false). &lt;br /&gt;
Use only &amp;lt;code&amp;gt;&amp;quot;\n&amp;quot;&amp;lt;/code&amp;gt;, not &amp;lt;code&amp;gt;&amp;quot;\r\n&amp;quot;&amp;lt;/code&amp;gt;in post content. &lt;br /&gt;
Comments in response body starts with &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
#symbol.&lt;br /&gt;
&lt;br /&gt;
=== Request status ===&lt;br /&gt;
To get real request/post status you need to check status code in first line of server response.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Perl ===&lt;br /&gt;
To get the results of a single request (without setting the Session-Cookie) - assuming you&#039;ve set:&lt;br /&gt;
&lt;br /&gt;
* $uri to your RT REST URL&lt;br /&gt;
* $access_user to your username&lt;br /&gt;
* $access_password to your password&lt;br /&gt;
* $ticketNumber to the ticket you want to see&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
my $ua = LWP::UserAgent-&amp;amp;gt;new;&lt;br /&gt;
$ua-&amp;gt;timeout(10);&lt;br /&gt;
$ua-&amp;gt;agent(&amp;quot;YOURUSERAGENTHERE&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
my $response = $ua-&amp;gt;post($uri.&amp;quot;ticket/$ticketNumber&amp;quot;,&lt;br /&gt;
   [&#039;user&#039; =&amp;gt; $access_user, &#039;pass&#039; =&amp;gt; $access_password],&lt;br /&gt;
    &#039;Content_Type&#039; =&amp;gt; &#039;form-data&#039;);&lt;br /&gt;
&lt;br /&gt;
if ($response-&amp;amp;gt;is_success) {&lt;br /&gt;
   print $response-&amp;gt;decoded_content;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import org.apache.commons.httpclient.HttpClient;&lt;br /&gt;
import org.apache.commons.httpclient.methods.PostMethod;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.Part;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.StringPart;&lt;br /&gt;
  &lt;br /&gt;
public class RtTicketCreator {&lt;br /&gt;
   static final String BASE_URI = &amp;quot;http://rt.xxx.com/REST/1.0&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
   public static void main(String[] args) throws IOException {&lt;br /&gt;
 &lt;br /&gt;
      PostMethod mPost = new PostMethod(BASE_URI + &amp;quot;/ticket/new?user=username&amp;amp;amp;pass=password&amp;quot;);&lt;br /&gt;
      Part[] parts = { new StringPart(&amp;quot;content&amp;quot;, &amp;quot;Queue: General\nSubject: 123&amp;quot;) };&lt;br /&gt;
      mPost.setRequestEntity(new MultipartRequestEntity(parts, mPost.getParams()));&lt;br /&gt;
      HttpClient cl = new HttpClient();&lt;br /&gt;
      cl.executeMethod(mPost);&lt;br /&gt;
      System.out.println(mPost.getResponseBodyAsString());&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Java ( Based on new Apache HttpComponents library ) ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
* RT ticket creator based on the current Apache HttpComponents library 4.1.3&lt;br /&gt;
* Created by Koustubha Kale, kmkale at youtility dot in&lt;br /&gt;
*/&lt;br /&gt;
import org.apache.http.HttpEntity;&lt;br /&gt;
import org.apache.http.HttpResponse;&lt;br /&gt;
import org.apache.http.auth.AuthScope;&lt;br /&gt;
import org.apache.http.auth.UsernamePasswordCredentials;&lt;br /&gt;
import org.apache.http.client.HttpClient;&lt;br /&gt;
import org.apache.http.client.methods.HttpPost;&lt;br /&gt;
import org.apache.http.entity.mime.MultipartEntity;&lt;br /&gt;
import org.apache.http.entity.mime.content.StringBody;&lt;br /&gt;
import org.apache.http.impl.client.DefaultHttpClient;&lt;br /&gt;
import org.apache.http.util.EntityUtils;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class NewApacheHttpcomponentsRtTicketCreator {&lt;br /&gt;
&lt;br /&gt;
    public static void main(String[] args) throws Exception {&lt;br /&gt;
        &lt;br /&gt;
        DefaultHttpClient httpclient = new DefaultHttpClient();&lt;br /&gt;
	try {&lt;br /&gt;
            &lt;br /&gt;
            HttpPost httppost = new HttpPost(&amp;quot;http://rt.xxx.com/rt/REST/1.0&amp;quot; +&lt;br /&gt;
                    &amp;quot;/ticket/new?user=username&amp;amp;pass=password&amp;quot;);&lt;br /&gt;
	    StringBody content = new StringBody(&amp;quot;Queue: General\nSubject: 123&amp;quot;);&lt;br /&gt;
	    MultipartEntity reqEntity = new MultipartEntity();&lt;br /&gt;
	    reqEntity.addPart(&amp;quot;content&amp;quot;, content);&lt;br /&gt;
	    httppost.setEntity(reqEntity);&lt;br /&gt;
	    System.out.println(&amp;quot;executing request &amp;quot; + httppost.getRequestLine());&lt;br /&gt;
            HttpResponse response = httpclient.execute(httppost);&lt;br /&gt;
            HttpEntity resEntity = response.getEntity();&lt;br /&gt;
&lt;br /&gt;
            System.out.println(&amp;quot;----------------------------------------&amp;quot;);&lt;br /&gt;
            System.out.println(response.getStatusLine());&lt;br /&gt;
            if (resEntity != null) {&lt;br /&gt;
                System.out.println(&amp;quot;Response content length: &amp;quot; + resEntity.getContentLength());&lt;br /&gt;
            }&lt;br /&gt;
            EntityUtils.consume(resEntity);&lt;br /&gt;
        } finally {&lt;br /&gt;
            try { httpclient.getConnectionManager().shutdown(); } catch (Exception ignore) {}&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import cookielib&lt;br /&gt;
import urllib&lt;br /&gt;
import urllib2&lt;br /&gt;
       &lt;br /&gt;
# creates a cookie for the rtserver with the credentials given at initialization.&lt;br /&gt;
# define your credentials here&lt;br /&gt;
access_user = &#039;your_login&#039;&lt;br /&gt;
access_password = &#039;your_password&#039;&lt;br /&gt;
       &lt;br /&gt;
# here is the RequestTracker URI we try to access&lt;br /&gt;
uri = &#039;http://your-rt-instance.com/REST/1.0/&#039;&lt;br /&gt;
       &lt;br /&gt;
# trying login on rt server&lt;br /&gt;
cj = cookielib.LWPCookieJar()&lt;br /&gt;
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))&lt;br /&gt;
urllib2.install_opener(opener)&lt;br /&gt;
data = {&#039;user&#039;: access_user, &#039;pass&#039;: access_password}&lt;br /&gt;
ldata = urllib.urlencode(data)&lt;br /&gt;
login = urllib2.Request(uri, ldata)&lt;br /&gt;
try:&lt;br /&gt;
   response = urllib2.urlopen(login)&lt;br /&gt;
   print response.read()&lt;br /&gt;
   print &amp;quot;login successful&amp;quot;&lt;br /&gt;
except urllib2.URLError:&lt;br /&gt;
   # could not connect to server&lt;br /&gt;
   print &amp;quot;Not able to login&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ruby ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env ruby&lt;br /&gt;
require &#039;net/http&#039;&lt;br /&gt;
&lt;br /&gt;
user = &#039;username&#039;&lt;br /&gt;
pass = &#039;password&#039;&lt;br /&gt;
uri = URI(&#039;https://rt.example.com/REST/1.0/ticket/123/show&#039;)&lt;br /&gt;
&lt;br /&gt;
req = Net::HTTP::Post.new(uri.path)&lt;br /&gt;
req.set_form_data(&#039;user&#039; =&amp;gt; user, &#039;pass&#039; =&amp;gt; pass)&lt;br /&gt;
&lt;br /&gt;
res = Net::HTTP.start(uri.hostname, uri.port, &lt;br /&gt;
  :use_ssl =&amp;gt; uri.scheme == &#039;https&#039;, &lt;br /&gt;
  :set_debug_output =&amp;gt; $stderr) do |http|&lt;br /&gt;
  http.request(req)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
case res&lt;br /&gt;
when Net::HTTPSuccess, Net::HTTPRedirection&lt;br /&gt;
  # OK&lt;br /&gt;
  puts &amp;quot;HTTP response code:  #{res.code}&amp;quot;&lt;br /&gt;
  puts &amp;quot;HTTP message: #{res.message}&amp;quot;&lt;br /&gt;
  puts &amp;quot;Response:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  res.each do |key,val|&lt;br /&gt;
    puts &amp;quot;#{key} =&amp;gt; #{val}&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  puts &amp;quot;Data:&amp;quot;&lt;br /&gt;
  puts res.body&lt;br /&gt;
else&lt;br /&gt;
  res.value&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PHP ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$username = rt_user;&lt;br /&gt;
$password = rt_pass;&lt;br /&gt;
$url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/&amp;lt;ticket id&amp;gt;/show?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
$request = new HttpRequest($url, HTTP_METH_GET);&lt;br /&gt;
/* if you want&#039;s to pass additional parameters */&lt;br /&gt;
$request-&amp;gt;addQueryData(array());&lt;br /&gt;
$response = $request-&amp;gt;send();&lt;br /&gt;
print_r($response);&lt;br /&gt;
&amp;lt;/pre&amp;gt; OR&amp;lt;pre&amp;gt;&lt;br /&gt;
$username = rt_user;&lt;br /&gt;
$password = rt_pass;&lt;br /&gt;
$url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/new?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
$request = new HttpRequest($url, HTTP_METH_POST);&lt;br /&gt;
// Note : to add data in custom fields you need to add element like below example&lt;br /&gt;
// in $post_data array&lt;br /&gt;
// Example : \nCF-customfield1:testdata&lt;br /&gt;
$post_data=array(&amp;quot;content&amp;quot;=&amp;gt;&amp;quot;Queue: General\nRequestor: user@domain\nSubject: REST test 1\nOwner: userX\nAdminCc: userX\nText: This is a REST test\n&amp;quot;);&lt;br /&gt;
$request-&amp;gt;addPostFields($post_data);&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
response = $request-&amp;gt;send()-&amp;gt;getBody();&lt;br /&gt;
print_r($response);&lt;br /&gt;
}catch (HttpException $ex) {&lt;br /&gt;
echo $ex;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C# ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Using &amp;quot;WCF REST Starter Kit&amp;quot; (http://msdn.microsoft.com/en-us/netframework/cc950529.aspx)&lt;br /&gt;
using (var client = new HttpClient(&amp;quot;http://rt.site.com/REST/1.0/&amp;quot;))&lt;br /&gt;
{&lt;br /&gt;
   client.TransportSettings.Cookies = new CookieContainer();&lt;br /&gt;
&lt;br /&gt;
   var form = new HttpUrlEncodedForm();&lt;br /&gt;
   form.Add(&amp;quot;user&amp;quot;, &amp;quot;LOGIN&amp;quot;);&lt;br /&gt;
   form.Add(&amp;quot;pass&amp;quot;, &amp;quot;PASSWORD&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
   client.Post(string.Empty, form.CreateHttpContent());&lt;br /&gt;
&lt;br /&gt;
   // 1. Get ticket data&lt;br /&gt;
   using (var request = client.Get(&amp;quot;ticket/1234/show&amp;quot;))&lt;br /&gt;
   {&lt;br /&gt;
      string content = request.Content.ReadAsString();&lt;br /&gt;
      // Some logic&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // 2. Post ticket reply with attachment&lt;br /&gt;
   var formPost = new HttpMultipartMimeForm();&lt;br /&gt;
   byte[] attachment = new byte[];&lt;br /&gt;
   string content = string.Empty;&lt;br /&gt;
         &lt;br /&gt;
   // Store data in attachment&lt;br /&gt;
   // Store data in content string (&amp;quot;Field: Value&amp;quot; line by line)&lt;br /&gt;
   // ...&lt;br /&gt;
         &lt;br /&gt;
   formPost.Add(&amp;quot;content&amp;quot;, content);&lt;br /&gt;
   formPost.Add(&amp;quot;attachment_1&amp;quot;, &amp;quot;attachment_1&amp;quot;, HttpContent.Create(attachment, &amp;quot;application/octet-stream&amp;quot;));&lt;br /&gt;
                             &lt;br /&gt;
   using (var post = client.Post(&amp;quot;ticket/1234/comment&amp;quot;), formPost.CreateHttpContent()))&lt;br /&gt;
      // Some logic&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Powershell (v3)===&lt;br /&gt;
* Escape Powershell reserved chars in user/pass&lt;br /&gt;
* If connecting via SSL, use fqdn of server, not cname&lt;br /&gt;
*Use `n (newline) when composing new ticket structure&lt;br /&gt;
Read RT queue based on query: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$servername=&amp;quot;Your Servername here&amp;quot;&lt;br /&gt;
$u=&amp;quot;user=Username&amp;quot;&lt;br /&gt;
$p=&amp;quot;pass=Password&amp;quot;&lt;br /&gt;
$q=&amp;quot;search/ticket?query=(Status=&#039;open&#039; OR Status=&#039;new&#039;) AND (Queue=&#039;GENERAL&#039; OR Queue=&#039;FOO&#039;) AND Owner=&#039;Nobody&#039;&amp;quot;&lt;br /&gt;
$uri=&amp;quot;https://&amp;quot; + $servername + &amp;quot;/rt/REST/1.0/&amp;quot; + $q + &amp;quot;&amp;amp;&amp;quot; + $u + &amp;quot;&amp;amp;&amp;quot; + $p&lt;br /&gt;
$RT=Invoke-WebRequest -Uri  $uri -SessionVariable sess&lt;br /&gt;
$rt.Content&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===VB.NET===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Public Sub AddAttachmentToRT(ByVal url As String, ByVal fileName As String, ByVal filePath As String)&lt;br /&gt;
&lt;br /&gt;
        Dim dataBoundary As String = &amp;quot;--xYzZY&amp;quot;&lt;br /&gt;
        Dim request As HttpWebRequest&lt;br /&gt;
        Dim fileType As String = &amp;quot;image/jpeg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        &#039;Create a POST web request to the REST interface using the passed URL&lt;br /&gt;
        request = CType(WebRequest.Create(url), HttpWebRequest)&lt;br /&gt;
        request.ContentType = &amp;quot;multipart/form-data; boundary=xYzZY&amp;quot;&lt;br /&gt;
        request.Method = &amp;quot;POST&amp;quot;&lt;br /&gt;
        request.KeepAlive = True&lt;br /&gt;
&lt;br /&gt;
        &#039;Write the request to the requestStream&lt;br /&gt;
        Using requestStream As IO.Stream = request.GetRequestStream()&lt;br /&gt;
&lt;br /&gt;
            &#039;Create a variable &amp;quot;attachment_1&amp;quot; in the POST, specify the file name and file type&lt;br /&gt;
            Dim preAttachment As String = dataBoundary + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Disposition: form-data; name=&amp;quot;&amp;quot;attachment_1&amp;quot;&amp;quot;; filename=&amp;quot;&amp;quot;&amp;quot; + fileName + &amp;quot;&amp;quot;&amp;quot;&amp;quot; + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Type: &amp;quot; + fileType + vbCrLf _&lt;br /&gt;
            + vbCrLf&lt;br /&gt;
&lt;br /&gt;
            &#039;Convert this preAttachment string to bytes&lt;br /&gt;
            Dim preAttachmentBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(preAttachment)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write this preAttachment string to the stream&lt;br /&gt;
            requestStream.Write(preAttachmentBytes, 0, preAttachmentBytes.Length)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write the file as bytes to the stream by passing its exact location&lt;br /&gt;
            Using fileStream As New IO.FileStream(Server.MapPath(filePath + fileName), IO.FileMode.Open, IO.FileAccess.Read)&lt;br /&gt;
&lt;br /&gt;
                Dim buffer(4096) As Byte&lt;br /&gt;
                Dim bytesRead As Int32 = fileStream.Read(buffer, 0, buffer.Length)&lt;br /&gt;
&lt;br /&gt;
                Do While (bytesRead &amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
                    requestStream.Write(buffer, 0, bytesRead)&lt;br /&gt;
                    bytesRead = fileStream.Read(buffer, 0, buffer.Length)&lt;br /&gt;
&lt;br /&gt;
                Loop&lt;br /&gt;
&lt;br /&gt;
            End Using&lt;br /&gt;
&lt;br /&gt;
            &#039;Create a variable named content in the POST, specify the attachment name and comment text&lt;br /&gt;
            Dim postAttachment As String = vbCrLf _&lt;br /&gt;
            + dataBoundary + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Disposition: form-data; name=&amp;quot;&amp;quot;content&amp;quot;&amp;quot;&amp;quot; + vbCrLf _&lt;br /&gt;
            + vbCrLf _&lt;br /&gt;
            + &amp;quot;Action: comment&amp;quot; + vbLf _&lt;br /&gt;
            + &amp;quot;Attachment: &amp;quot; + fileName + vbCrLf _&lt;br /&gt;
            + &amp;quot;Text: Whatever You Want&amp;quot; + vbCrLf _&lt;br /&gt;
            + vbCrLf _&lt;br /&gt;
            + &amp;quot;--xYzZY--&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            &#039;Convert postAttachment string to bytes&lt;br /&gt;
            Dim postAttachmentBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(postAttachment)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write the postAttachment string to the stream&lt;br /&gt;
            requestStream.Write(postAttachmentBytes, 0, postAttachmentBytes.Length)&lt;br /&gt;
&lt;br /&gt;
        End Using&lt;br /&gt;
&lt;br /&gt;
        Dim response As Net.WebResponse = Nothing&lt;br /&gt;
&lt;br /&gt;
        &#039;Get the response from our REST request to RT&lt;br /&gt;
        &#039;Required to capture response, without this Try-Catch attaching will fail&lt;br /&gt;
        Try&lt;br /&gt;
            response = request.GetResponse()&lt;br /&gt;
&lt;br /&gt;
            Using responseStream As IO.Stream = response.GetResponseStream()&lt;br /&gt;
&lt;br /&gt;
                Using responseReader As New IO.StreamReader(responseStream)&lt;br /&gt;
&lt;br /&gt;
                    Dim responseText = responseReader.ReadToEnd()&lt;br /&gt;
&lt;br /&gt;
                End Using&lt;br /&gt;
&lt;br /&gt;
            End Using&lt;br /&gt;
&lt;br /&gt;
        Catch exception As Net.WebException&lt;br /&gt;
&lt;br /&gt;
            response = exception.Response&lt;br /&gt;
&lt;br /&gt;
            If (response IsNot Nothing) Then&lt;br /&gt;
&lt;br /&gt;
                Using reader As New IO.StreamReader(response.GetResponseStream())&lt;br /&gt;
&lt;br /&gt;
                    Dim responseText = reader.ReadToEnd()&lt;br /&gt;
&lt;br /&gt;
                End Using&lt;br /&gt;
&lt;br /&gt;
                response.Close()&lt;br /&gt;
&lt;br /&gt;
            End If&lt;br /&gt;
&lt;br /&gt;
        Finally&lt;br /&gt;
&lt;br /&gt;
            request = Nothing&lt;br /&gt;
&lt;br /&gt;
        End Try&lt;br /&gt;
&lt;br /&gt;
    End Sub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===JavaScript===&lt;br /&gt;
This is an example of updating the RefersTo field for a ticket. Assuming Zepto/jQuery is also being used.&lt;br /&gt;
 function link_back(url, ticket_num, rt) {&lt;br /&gt;
     var data, link;&lt;br /&gt;
     link = &amp;quot;refersto: &amp;quot; + url;&lt;br /&gt;
     data = {&amp;quot;content&amp;quot;: link};&lt;br /&gt;
 &lt;br /&gt;
     $.ajax({&lt;br /&gt;
         type: &amp;quot;POST&amp;quot;,&lt;br /&gt;
         url: rt + ticket_num + &amp;quot;/links&amp;quot;,&lt;br /&gt;
         data: data,&lt;br /&gt;
         success: function (reply) {&lt;br /&gt;
             console.log(reply);&lt;br /&gt;
         }&lt;br /&gt;
     });&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 var url = &amp;quot;https://www.wikipedia.org/&amp;quot;;&lt;br /&gt;
 var ticket_num = &amp;quot;123456&amp;quot;;&lt;br /&gt;
 var rt = &amp;quot;https://some.rt.url/REST/1.0/ticket/&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 link_back(url, ticket_num, rt);&lt;br /&gt;
&lt;br /&gt;
== Convenience libraries ==&lt;br /&gt;
&lt;br /&gt;
There are libraries which do much of the low-level work shown in the examples below for you, and provide an easier programming interface for dealing with RT:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Language&lt;br /&gt;
!Package/Module&lt;br /&gt;
!Source&lt;br /&gt;
!Example&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Perl&#039;&#039;&#039;&lt;br /&gt;
|[http://metacpan.org/module/RT::Client::REST RT::Client::REST]&lt;br /&gt;
|[http://rt-client-rest.googlecode.com/svn/trunk/ Google Code]&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;quot;perl -MCPAN -e install RT::Client::REST&amp;quot;&amp;lt;/code&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Ruby&#039;&#039;&#039;&lt;br /&gt;
|[http://rt-client.rubyforge.org RT-Client]&lt;br /&gt;
|[http://rubygems.org/gems/rt-client RubyGems]&lt;br /&gt;
|&amp;lt;code&amp;gt;gem install rt-client&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Ruby&#039;&#039;&#039;&lt;br /&gt;
|[http://rubygems.org/gems/roart Roart]&lt;br /&gt;
|[https://github.com/pjdavis/roart GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;gem install roart&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/z4r/python-rtkit rtkit]&lt;br /&gt;
|[https://github.com/ GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;pip install python-rtkit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
|[https://gitlab.labs.nic.cz/labs/python-rt python-rt]&lt;br /&gt;
|[https://gitlab.labs.nic.cz GitLab]&lt;br /&gt;
|&amp;lt;code&amp;gt;pip install rt&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Java&#039;&#039;&#039;&lt;br /&gt;
|[http://projects.boksa.de/RT-REST/ RT-REST]&lt;br /&gt;
|[https://github.com/bboksa/RT-REST GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;N/A&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;PHP&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/dersam/RTPHPLib RTPHPLib]&lt;br /&gt;
|[https://github.com/dersam/RTPHPLib GitHub]&lt;br /&gt;
|composer require dersam/rt-php-lib&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=REST&amp;diff=26446</id>
		<title>REST</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=REST&amp;diff=26446"/>
		<updated>2017-01-04T17:41:07Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
&lt;br /&gt;
The REST Interface gives you access to your RT Database. The complete communication is encapsulated in the HTTP protocol. The interface should be accessible in your installation.&lt;br /&gt;
&lt;br /&gt;
Though you may see references to older 3.x releases of RT below, Best Practice indicates that the REST stuff has not changed in any significant way in 4.x as of, at least, 1/2012.&lt;br /&gt;
&lt;br /&gt;
[{{SERVER}}/index.php?search={{TALKPAGENAME}}&amp;amp;title=Special:Search Legacy Comments] are available from the previous Wikia instance.&lt;br /&gt;
&lt;br /&gt;
== Interface ==&lt;br /&gt;
&lt;br /&gt;
Base URL: &amp;lt;code&amp;gt;.../REST/1.0/&amp;lt;/code&amp;gt;. The default response should be:&lt;br /&gt;
&lt;br /&gt;
    RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
    # Invalid object specification: &#039;index.html&#039;&lt;br /&gt;
&lt;br /&gt;
    id: index.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
The REST Interface does not support HTTP-Authentication. So you must get a valid Session-Token and submit the cookie each request. You usually get a Session-Cookie by submitting the default login form. Use variables &amp;quot;&amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt;&amp;quot; for login and &amp;quot;&amp;lt;code&amp;gt;pass&amp;lt;/code&amp;gt;&amp;quot; for password values. wget doesn&#039;t escape any characters in the --post-data option so make sure you properly escape any special characters in the password.&lt;br /&gt;
&lt;br /&gt;
See the wget invocation line below:&lt;br /&gt;
&lt;br /&gt;
    wget  --keep-session-cookies \&lt;br /&gt;
    --save-cookies cookies.txt \&lt;br /&gt;
    --post-data &#039;user=UUUU&amp;amp;pass=PPPP&#039; \&lt;br /&gt;
    http://my.rt.server&lt;br /&gt;
&lt;br /&gt;
You need the -keep-session-cookies option to make wget save session cookies.&lt;br /&gt;
&lt;br /&gt;
=== Ticket ===&lt;br /&gt;
&lt;br /&gt;
==== Ticket Properties ====&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single ticket, not including the history and comments.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.4.5 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;&lt;br /&gt;
 Queue: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Owner: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Creator: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Subject: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Status: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Priority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 InitialPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 FinalPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Requestors: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Cc: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 AdminCc: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Created: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Starts: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Started: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Due: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Resolved: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Told: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeEstimated: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeWorked: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeLeft: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Links ====&lt;br /&gt;
&lt;br /&gt;
Gets the ticket links for a single ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links/show&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.2 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&lt;br /&gt;
 HasMember: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 ReferredToBy: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 DependedOnBy: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 MemberOf: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 RefersTo: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 DependsOn: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachments ====&lt;br /&gt;
&lt;br /&gt;
Gets a list of all attachments related to the ticket&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachment ====&lt;br /&gt;
Gets the metadata and content of a specific attachment.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments/&amp;amp;lt;attachment-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.8.0 200 Ok&lt;br /&gt;
 &lt;br /&gt;
id: &amp;lt;attachment-id&amp;gt;&lt;br /&gt;
Subject:&lt;br /&gt;
Creator: &amp;lt;user-id&amp;gt;&lt;br /&gt;
Created: &amp;lt;timestamp&amp;gt;&lt;br /&gt;
Transaction: &amp;lt;transaction-id&amp;gt;&lt;br /&gt;
Parent: &amp;lt;parent-id&amp;gt;&lt;br /&gt;
MessageId:&lt;br /&gt;
Filename: &amp;lt;filename&amp;gt;&lt;br /&gt;
ContentType: application/octet-stream&lt;br /&gt;
ContentEncoding: none&lt;br /&gt;
 &lt;br /&gt;
Headers: MIME-Version: 1.0&lt;br /&gt;
         X-Mailer: MIME-tools 5.427 (Entity 5.427)&lt;br /&gt;
         Content-Type: application/octet-stream;&lt;br /&gt;
           name=&amp;quot;&amp;lt;filename&amp;gt;&amp;quot;&lt;br /&gt;
         Content-Disposition: inline; filename=&amp;quot;&amp;lt;filename&amp;gt;&amp;quot;&lt;br /&gt;
         Content-Transfer-Encoding: base64&lt;br /&gt;
         Content-Length: &amp;lt;length in bytes&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Content: ...&lt;br /&gt;
         ...&lt;br /&gt;
         ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE: RT returns the content indented with 9 spaces on each line, so that it lines up with the &amp;quot;Content:&amp;quot; header. Even if you strip this out with a regexp, the content is still UTF-8, which is probably not what you want. To get the original binary data back, strip out the 9 spaces with a regexp, strip off the 3 carriage returns at the end, and then convert the whole thing from UTF-8 to the native character encoding of the attachment, whatever that is. RT doesn&#039;t tell you, so you have know. If the attachments were uploaded by a U.S. Windows system, odds are that Windows-1252 is what you want. If you can&#039;t get the binary back intact, see the next method below.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachment Content ====&lt;br /&gt;
&lt;br /&gt;
Gets the attachment data content without additional metadata or whitespace characters&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments/&amp;amp;lt;attachment-id&amp;amp;gt;/content&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.0 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
So to get the original content you still have to strip the first 2 lines of the response.&lt;br /&gt;
&lt;br /&gt;
==== Ticket History ====&lt;br /&gt;
Gets a list of all the history items for a given ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;history-count&amp;gt;/&amp;lt;history-count&amp;gt; (/total)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;history-id&amp;gt;: &amp;lt;history-name&amp;gt;&lt;br /&gt;
&amp;lt;history-id&amp;gt;: &amp;lt;history-name&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get an additional row, for each history entry found. The first entry is usually: &amp;quot;&amp;lt;code&amp;gt;Ticket created by ...&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
There are two ways to get history item detail: you can do one of these and then recursively perform &amp;lt;code&amp;gt;ticket/history/id/&amp;amp;lt;history-id&amp;amp;gt;&amp;lt;/code&amp;gt; for each history-id from this REST call, but that is extremely wasteful and will scale horribly. What you really want to do is one REST call but get the long format:&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history?format=l&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.8.2 200 Ok&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;n&amp;gt;/&amp;lt;n&amp;gt; (id/&amp;amp;lt;history-id&amp;amp;gt;/total)&lt;br /&gt;
&lt;br /&gt;
id: &amp;lt;history-id&amp;gt;&lt;br /&gt;
Ticket: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
TimeTaken: &amp;lt;...&amp;gt;&lt;br /&gt;
Type: &amp;lt;...&amp;gt;&lt;br /&gt;
Field: &amp;lt;...&amp;gt;&lt;br /&gt;
OldValue: &amp;lt;...&amp;gt;&lt;br /&gt;
NewValue: &amp;lt;...&amp;gt;&lt;br /&gt;
Data: &amp;lt;...&amp;gt;&lt;br /&gt;
Description: &amp;lt;...&amp;gt;&lt;br /&gt;
Content: &amp;lt;...&amp;gt;&lt;br /&gt;
Creator: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Created: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attachments:&lt;br /&gt;
             &amp;lt;attachment-id&amp;gt;: &amp;lt;filename&amp;gt; (&amp;lt;size&amp;gt;)&lt;br /&gt;
             &amp;lt;attachment-id&amp;gt;: &amp;lt;filename&amp;gt; (&amp;lt;size&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;n&amp;gt;/&amp;lt;n&amp;gt; (id/&amp;amp;lt;history-id&amp;amp;gt;/total)&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE: the double dash &amp;quot;--&amp;quot; will occur in the long format between each history item. You can split the output on &amp;quot;--&amp;quot; and iterate over it, parsing out the data with an RFC822 parser, such as an email handling library.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Ticket History Entry ====&lt;br /&gt;
Gets the history information for a single history item. Note that the history item must actually correspond to the ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history/id/&amp;amp;lt;history-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
# 70/70 (id/114856/total)&lt;br /&gt;
&lt;br /&gt;
id: &amp;lt;history-id&amp;gt;&lt;br /&gt;
Ticket: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
TimeTaken: &amp;lt;...&amp;gt;&lt;br /&gt;
Type: &amp;lt;...&amp;gt;&lt;br /&gt;
Field: &amp;lt;...&amp;gt;&lt;br /&gt;
OldValue: &amp;lt;...&amp;gt;&lt;br /&gt;
NewValue: &amp;lt;...&amp;gt;&lt;br /&gt;
Data: &amp;lt;...&amp;gt;&lt;br /&gt;
Description: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Content: &amp;lt;lin1-0&amp;gt;&lt;br /&gt;
         &amp;lt;line-1&amp;gt;&lt;br /&gt;
         ...&lt;br /&gt;
         &amp;lt;line-n&amp;gt;&lt;br /&gt;
         &lt;br /&gt;
Creator: &amp;lt;...&amp;gt;&lt;br /&gt;
Created: &amp;lt;...&amp;gt;&lt;br /&gt;
Attachments: &amp;lt;...&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IMPORTANT NOTE: At least with RT 3.8.0, when you request a history item with this method AND you have attached a file that has Mime type text/plain to the same item (eg. a comment with an attachement), RT will return the complete content of the attachment for the key &amp;quot;Content:&amp;quot; and not your real comment that you can see in the web frontend. This may lead to some problems if the requestor does not expect to get a comment content that is for example 1.8 MB of text. With other Mime type attachments this however seems to work. I don&#039;t know if this is a feature or a bug.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &#039;&#039;&#039;Ticket Search&#039;&#039;&#039; ====&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=&amp;amp;lt;query&amp;amp;gt;&amp;amp;orderby=&amp;amp;lt;sort-order&amp;amp;gt;&amp;amp;format=&amp;amp;lt;format&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;query&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use any query generated by the query builder - or feel free to write your own. Here an example that will do the following: Find all tickets that have no owner and the status new or open&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;query= Owner = &#039;Nobody&#039; AND ( Status = &#039;new&#039; OR Status = &#039;open&#039; )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: to get all the tickets in &amp;quot;fooQueue&amp;quot; you&#039;d access:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: to get the tickets for a custom field &amp;quot;Contact Name&amp;quot; you&#039;d access:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=&#039;CF.{Contact Name}&#039;=&#039;Shaun Wallace&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;orderby&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By this parameter you can change the sort field and order of the search result. To sort a list ascending just put a + before the fieldname, otherwise a -. Eg: -Created (will put the newest tickets at the beginning).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;amp;orderby=+Created&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;format&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* i: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;&lt;br /&gt;
* s: &amp;amp;lt;ticket-id&amp;amp;gt;: &amp;amp;lt;ticket-subject&amp;amp;gt;&lt;br /&gt;
* l: a multi-line format&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;amp;orderby=+Created&amp;amp;format=i&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &#039;&#039;&#039;Ticket Create&#039;&#039;&#039; ====&lt;br /&gt;
&lt;br /&gt;
To create a new ticket: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/new&amp;lt;/code&amp;gt; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line, example:&lt;br /&gt;
&lt;br /&gt;
Testing the new ticket section&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: ticket/new&lt;br /&gt;
Queue: &amp;lt;queue name&amp;gt;&lt;br /&gt;
Requestor: &amp;lt;requestor email address&amp;gt;&lt;br /&gt;
Subject: &amp;lt;subject&amp;gt;&lt;br /&gt;
Cc: &amp;lt;...&amp;gt;&lt;br /&gt;
AdminCc: &amp;lt;...&amp;gt;&lt;br /&gt;
Owner: &amp;lt;...&amp;gt;&lt;br /&gt;
Status: &amp;lt;...&amp;gt;&lt;br /&gt;
Priority: &amp;lt;...&amp;gt;&lt;br /&gt;
InitialPriority: &amp;lt;...&amp;gt;&lt;br /&gt;
FinalPriority: &amp;lt;...&amp;gt;&lt;br /&gt;
TimeEstimated: &amp;lt;...&amp;gt;&lt;br /&gt;
Starts: &amp;lt;...&amp;gt;&lt;br /&gt;
Due: &amp;lt;...&amp;gt;&lt;br /&gt;
Text: &amp;lt;The ticket content&amp;gt;&lt;br /&gt;
CF-&amp;lt;CustomFieldName&amp;gt;: &amp;lt;CustomFieldValue&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are any &amp;quot;special&amp;quot; characters (Umlauts, dash, ...?) in a custom field&#039;s name, you can still access it via its ID:&lt;br /&gt;
 CF-$id: &amp;lt;Value&amp;gt;&lt;br /&gt;
If you want to have a multiline Text, prefix every line with a blank.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Due: &amp;lt;...&amp;gt;&lt;br /&gt;
Text: This is &lt;br /&gt;
 a &lt;br /&gt;
 multiline Text&lt;br /&gt;
 !!!&lt;br /&gt;
CF-&amp;lt;CustomFieldName&amp;gt;: &amp;lt;CustomFieldValue&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response should look like: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/4.0.6 200 Ok&lt;br /&gt;
&lt;br /&gt;
# Ticket 775 created.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== curl example =====&lt;br /&gt;
    &lt;br /&gt;
  * Create a file containing the ticket form:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: ticket/new&lt;br /&gt;
Queue: queue1&lt;br /&gt;
Requestor: requestor@email&lt;br /&gt;
Priority: 4&lt;br /&gt;
CF-Type of request: Demande&lt;br /&gt;
Subject: Test REST&lt;br /&gt;
Text: Multi line&lt;br /&gt;
 test with&lt;br /&gt;
 special chars: é&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  * Submit using curl:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
curl --data-urlencode content@file.name &#039;https://HOSTNAME/REST/1.0/ticket/new?user=USER&amp;amp;pass=PASSWORD&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Ticket Edit ====&lt;br /&gt;
To update an existing ticket: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/edit&amp;lt;/code&amp;gt; with a variable named &amp;quot;content&amp;quot;, containing &amp;quot;key: value&amp;quot; line by line (like the one displayed when issuing &amp;lt;code&amp;gt;ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;). Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Priority: 5&lt;br /&gt;
TimeWorked: 15&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*PHP&lt;br /&gt;
   &amp;lt;pre&amp;gt; &lt;br /&gt;
                    $username = rt_user;&lt;br /&gt;
                    $password = rt_pass;&lt;br /&gt;
                    $url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/&amp;lt;ticket id&amp;gt;/edit?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
                    $request = new HttpRequest($url, HTTP_METH_POST);&lt;br /&gt;
                    $post_data=array(&amp;quot;content&amp;quot;=&amp;gt;&amp;quot;AdminCc: userX\nText: This is a REST test edit ticket\n&amp;quot;);&lt;br /&gt;
                    &lt;br /&gt;
                    // add the post fields  &lt;br /&gt;
                    $request-&amp;gt;addPostFields($postData);&lt;br /&gt;
                    // response from RT&lt;br /&gt;
                    $response = $request-&amp;gt;send()-&amp;gt;getBody();&lt;br /&gt;
                    print_r($response);&lt;br /&gt;
                    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tickets History Reply ====&lt;br /&gt;
Same as comment: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/comment&amp;lt;/code&amp;gt; with a variable name &amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
Action: correspond&lt;br /&gt;
Text: the text comment&lt;br /&gt;
Cc: &amp;lt;...&amp;gt;&lt;br /&gt;
Bcc: &amp;lt;...&amp;gt;&lt;br /&gt;
TimeWorked: &amp;lt;...&amp;gt;&lt;br /&gt;
Attachment: an attachment filename/path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Cc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Bcc&amp;lt;/code&amp;gt; are for this reply only (&#039;&#039;I think&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
==== Ticket History Comment ====&lt;br /&gt;
To add a comment to an existing ticket: POST on &amp;quot;&amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/comment&amp;lt;/code&amp;gt;&amp;quot; with a variable name &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
Action: comment&lt;br /&gt;
Text: the text comment&lt;br /&gt;
Attachment: an attachment filename/path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Action can be &amp;quot;&amp;lt;code&amp;gt;comment&amp;lt;/code&amp;gt;&amp;quot; or &amp;quot;&amp;lt;code&amp;gt;correspond&amp;lt;/code&amp;gt;&amp;quot;. For a list of fields you can use in correspondence, try &amp;quot;&amp;lt;code&amp;gt;/opt/rt3/bin/rt correspond ticket/1&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your comment contains multiple lines, each new line must be preceded by a space (e.g. &amp;quot;line 1\n line 2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you want to use HTML replies, use &amp;lt;pre&amp;gt;Content-Type: text/html&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you used &amp;quot;&amp;lt;code&amp;gt;Attachment&amp;lt;/code&amp;gt;&amp;quot;, you must add to your POST a variable &amp;quot;&amp;lt;code&amp;gt;attachment_1&amp;lt;/code&amp;gt;&amp;quot; that contains the raw attachment in multi-part file object.&lt;br /&gt;
&lt;br /&gt;
You can upload more attachments as well, in this case you have to separate the file names in the &amp;quot;&amp;lt;code style=&amp;quot;border-style: initial; border-color: initial; &amp;quot;&amp;gt;Attachment&amp;lt;/code&amp;gt;&amp;quot; with &amp;quot;\n &amp;quot;(a newline and space, without quotes) and add a new variable &amp;quot;attachment_$i&amp;quot; to your POST where $i is the index of attachment.&lt;br /&gt;
&lt;br /&gt;
You need to send header to post comments&lt;br /&gt;
&lt;br /&gt;
==== Ticket Links Edit ====&lt;br /&gt;
To update links on an existing ticket: POST on &amp;quot;&amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&amp;lt;/code&amp;gt;&amp;quot; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line (like the one displayed when issuing &amp;quot;&amp;lt;code&amp;gt;ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&amp;lt;/code&amp;gt;&amp;quot;). Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DependsOn: 54354&lt;br /&gt;
RefersTo: http://some.external/link&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== User Properties ===&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single user.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/user/&amp;amp;lt;user-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.4 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: user/&amp;amp;lt;user-id&amp;amp;gt;&lt;br /&gt;
 Name: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Password: ********&lt;br /&gt;
 EmailAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 RealName: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Organization: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Privileged: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Disabled: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also you can use user login instead of user ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ===&lt;br /&gt;
&lt;br /&gt;
==== User Create ====&lt;br /&gt;
&lt;br /&gt;
To create a new user: post on &amp;lt;code&amp;gt;/REST/1.0/user/new&amp;lt;/code&amp;gt; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line, like the response to &amp;lt;code&amp;gt;/user/&amp;amp;lt;ticket-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== User Edit ====&lt;br /&gt;
To update an existing user: post on &amp;lt;code&amp;gt;/REST/1.0/user/&amp;amp;lt;user-id&amp;amp;gt;/edit&amp;lt;/code&amp;gt; with a variable named &amp;quot;content&amp;quot;, containing &amp;quot;key: value&amp;quot; line by line (like the one displayed when issuing &amp;lt;code&amp;gt;user/&amp;amp;lt;user-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Queue Properties ===&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single queue.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/queue/&amp;amp;lt;queue-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.4 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: queue/&amp;amp;lt;queue-id&amp;amp;gt;&lt;br /&gt;
 Name: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Description: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 CorrespondAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 CommentAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 InitialPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 FinalPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 DefaultDueIn: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Logout ===&lt;br /&gt;
&lt;br /&gt;
To logout: post on &amp;lt;code&amp;gt;/REST/1.0/logout&amp;lt;/code&amp;gt; with empty content.&lt;br /&gt;
&lt;br /&gt;
== Types ==&lt;br /&gt;
&lt;br /&gt;
*new&lt;br /&gt;
*open&lt;br /&gt;
*stalled&lt;br /&gt;
*resolved&lt;br /&gt;
*rejected&lt;br /&gt;
*deleted&lt;br /&gt;
+ other custom values defined in you local RT portal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== History entry type ===&lt;br /&gt;
* Create&lt;br /&gt;
* CustomField&lt;br /&gt;
* EmailRecord&lt;br /&gt;
* Status&lt;br /&gt;
* CommentEmailRecord&lt;br /&gt;
* Correspond&lt;br /&gt;
* Comment&lt;br /&gt;
* Priority&lt;br /&gt;
* Give&lt;br /&gt;
* Steal&lt;br /&gt;
* Take&lt;br /&gt;
* Untake&lt;br /&gt;
* AddWatcher&lt;br /&gt;
* DeleteWatcher&lt;br /&gt;
* AddLink&lt;br /&gt;
* DeleteLink&lt;br /&gt;
* AddReminder&lt;br /&gt;
* OpenReminder&lt;br /&gt;
* ResolveReminder&lt;br /&gt;
* Set&lt;br /&gt;
* Force&lt;br /&gt;
* Subject&lt;br /&gt;
* Told&lt;br /&gt;
* PurgeTransaction&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
=== Data format ===&lt;br /&gt;
History entries time returns in UTC, boolean returns as &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; (true) and &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;(false). &lt;br /&gt;
Use only &amp;lt;code&amp;gt;&amp;quot;\n&amp;quot;&amp;lt;/code&amp;gt;, not &amp;lt;code&amp;gt;&amp;quot;\r\n&amp;quot;&amp;lt;/code&amp;gt;in post content. &lt;br /&gt;
Comments in response body starts with &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
#symbol.&lt;br /&gt;
&lt;br /&gt;
=== Request status ===&lt;br /&gt;
To get real request/post status you need to check status code in first line of server response.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Perl ===&lt;br /&gt;
To get the results of a single request (without setting the Session-Cookie) - assuming you&#039;ve set:&lt;br /&gt;
&lt;br /&gt;
* $uri to your RT REST URL&lt;br /&gt;
* $access_user to your username&lt;br /&gt;
* $access_password to your password&lt;br /&gt;
* $ticketNumber to the ticket you want to see&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
my $ua = LWP::UserAgent-&amp;amp;gt;new;&lt;br /&gt;
$ua-&amp;gt;timeout(10);&lt;br /&gt;
$ua-&amp;gt;agent(&amp;quot;YOURUSERAGENTHERE&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
my $response = $ua-&amp;gt;post($uri.&amp;quot;ticket/$ticketNumber&amp;quot;,&lt;br /&gt;
   [&#039;user&#039; =&amp;gt; $access_user, &#039;pass&#039; =&amp;gt; $access_password],&lt;br /&gt;
    &#039;Content_Type&#039; =&amp;gt; &#039;form-data&#039;);&lt;br /&gt;
&lt;br /&gt;
if ($response-&amp;amp;gt;is_success) {&lt;br /&gt;
   print $response-&amp;gt;decoded_content;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import org.apache.commons.httpclient.HttpClient;&lt;br /&gt;
import org.apache.commons.httpclient.methods.PostMethod;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.Part;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.StringPart;&lt;br /&gt;
  &lt;br /&gt;
public class RtTicketCreator {&lt;br /&gt;
   static final String BASE_URI = &amp;quot;http://rt.xxx.com/REST/1.0&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
   public static void main(String[] args) throws IOException {&lt;br /&gt;
 &lt;br /&gt;
      PostMethod mPost = new PostMethod(BASE_URI + &amp;quot;/ticket/new?user=username&amp;amp;amp;pass=password&amp;quot;);&lt;br /&gt;
      Part[] parts = { new StringPart(&amp;quot;content&amp;quot;, &amp;quot;Queue: General\nSubject: 123&amp;quot;) };&lt;br /&gt;
      mPost.setRequestEntity(new MultipartRequestEntity(parts, mPost.getParams()));&lt;br /&gt;
      HttpClient cl = new HttpClient();&lt;br /&gt;
      cl.executeMethod(mPost);&lt;br /&gt;
      System.out.println(mPost.getResponseBodyAsString());&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Java ( Based on new Apache HttpComponents library ) ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
* RT ticket creator based on the current Apache HttpComponents library 4.1.3&lt;br /&gt;
* Created by Koustubha Kale, kmkale at youtility dot in&lt;br /&gt;
*/&lt;br /&gt;
import org.apache.http.HttpEntity;&lt;br /&gt;
import org.apache.http.HttpResponse;&lt;br /&gt;
import org.apache.http.auth.AuthScope;&lt;br /&gt;
import org.apache.http.auth.UsernamePasswordCredentials;&lt;br /&gt;
import org.apache.http.client.HttpClient;&lt;br /&gt;
import org.apache.http.client.methods.HttpPost;&lt;br /&gt;
import org.apache.http.entity.mime.MultipartEntity;&lt;br /&gt;
import org.apache.http.entity.mime.content.StringBody;&lt;br /&gt;
import org.apache.http.impl.client.DefaultHttpClient;&lt;br /&gt;
import org.apache.http.util.EntityUtils;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class NewApacheHttpcomponentsRtTicketCreator {&lt;br /&gt;
&lt;br /&gt;
    public static void main(String[] args) throws Exception {&lt;br /&gt;
        &lt;br /&gt;
        DefaultHttpClient httpclient = new DefaultHttpClient();&lt;br /&gt;
	try {&lt;br /&gt;
            &lt;br /&gt;
            HttpPost httppost = new HttpPost(&amp;quot;http://rt.xxx.com/rt/REST/1.0&amp;quot; +&lt;br /&gt;
                    &amp;quot;/ticket/new?user=username&amp;amp;pass=password&amp;quot;);&lt;br /&gt;
	    StringBody content = new StringBody(&amp;quot;Queue: General\nSubject: 123&amp;quot;);&lt;br /&gt;
	    MultipartEntity reqEntity = new MultipartEntity();&lt;br /&gt;
	    reqEntity.addPart(&amp;quot;content&amp;quot;, content);&lt;br /&gt;
	    httppost.setEntity(reqEntity);&lt;br /&gt;
	    System.out.println(&amp;quot;executing request &amp;quot; + httppost.getRequestLine());&lt;br /&gt;
            HttpResponse response = httpclient.execute(httppost);&lt;br /&gt;
            HttpEntity resEntity = response.getEntity();&lt;br /&gt;
&lt;br /&gt;
            System.out.println(&amp;quot;----------------------------------------&amp;quot;);&lt;br /&gt;
            System.out.println(response.getStatusLine());&lt;br /&gt;
            if (resEntity != null) {&lt;br /&gt;
                System.out.println(&amp;quot;Response content length: &amp;quot; + resEntity.getContentLength());&lt;br /&gt;
            }&lt;br /&gt;
            EntityUtils.consume(resEntity);&lt;br /&gt;
        } finally {&lt;br /&gt;
            try { httpclient.getConnectionManager().shutdown(); } catch (Exception ignore) {}&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import cookielib&lt;br /&gt;
import urllib&lt;br /&gt;
import urllib2&lt;br /&gt;
       &lt;br /&gt;
# creates a cookie for the rtserver with the credentials given at initialization.&lt;br /&gt;
# define your credentials here&lt;br /&gt;
access_user = &#039;your_login&#039;&lt;br /&gt;
access_password = &#039;your_password&#039;&lt;br /&gt;
       &lt;br /&gt;
# here is the RequestTracker URI we try to access&lt;br /&gt;
uri = &#039;http://your-rt-instance.com/REST/1.0/&#039;&lt;br /&gt;
       &lt;br /&gt;
# trying login on rt server&lt;br /&gt;
cj = cookielib.LWPCookieJar()&lt;br /&gt;
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))&lt;br /&gt;
urllib2.install_opener(opener)&lt;br /&gt;
data = {&#039;user&#039;: access_user, &#039;pass&#039;: access_password}&lt;br /&gt;
ldata = urllib.urlencode(data)&lt;br /&gt;
login = urllib2.Request(uri, ldata)&lt;br /&gt;
try:&lt;br /&gt;
   response = urllib2.urlopen(login)&lt;br /&gt;
   print response.read()&lt;br /&gt;
   print &amp;quot;login successful&amp;quot;&lt;br /&gt;
except urllib2.URLError:&lt;br /&gt;
   # could not connect to server&lt;br /&gt;
   print &amp;quot;Not able to login&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ruby ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env ruby&lt;br /&gt;
require &#039;net/http&#039;&lt;br /&gt;
&lt;br /&gt;
user = &#039;username&#039;&lt;br /&gt;
pass = &#039;password&#039;&lt;br /&gt;
uri = URI(&#039;https://rt.example.com/REST/1.0/ticket/123/show&#039;)&lt;br /&gt;
&lt;br /&gt;
req = Net::HTTP::Post.new(uri.path)&lt;br /&gt;
req.set_form_data(&#039;user&#039; =&amp;gt; user, &#039;pass&#039; =&amp;gt; pass)&lt;br /&gt;
&lt;br /&gt;
res = Net::HTTP.start(uri.hostname, uri.port, &lt;br /&gt;
  :use_ssl =&amp;gt; uri.scheme == &#039;https&#039;, &lt;br /&gt;
  :set_debug_output =&amp;gt; $stderr) do |http|&lt;br /&gt;
  http.request(req)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
case res&lt;br /&gt;
when Net::HTTPSuccess, Net::HTTPRedirection&lt;br /&gt;
  # OK&lt;br /&gt;
  puts &amp;quot;HTTP response code:  #{res.code}&amp;quot;&lt;br /&gt;
  puts &amp;quot;HTTP message: #{res.message}&amp;quot;&lt;br /&gt;
  puts &amp;quot;Response:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  res.each do |key,val|&lt;br /&gt;
    puts &amp;quot;#{key} =&amp;gt; #{val}&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  puts &amp;quot;Data:&amp;quot;&lt;br /&gt;
  puts res.body&lt;br /&gt;
else&lt;br /&gt;
  res.value&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PHP ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$username = rt_user;&lt;br /&gt;
$password = rt_pass;&lt;br /&gt;
$url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/&amp;lt;ticket id&amp;gt;/show?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
$request = new HttpRequest($url, HTTP_METH_GET);&lt;br /&gt;
/* if you want&#039;s to pass additional parameters */&lt;br /&gt;
$request-&amp;gt;addQueryData(array());&lt;br /&gt;
$response = $request-&amp;gt;send();&lt;br /&gt;
print_r($response);&lt;br /&gt;
&amp;lt;/pre&amp;gt; OR&amp;lt;pre&amp;gt;&lt;br /&gt;
$username = rt_user;&lt;br /&gt;
$password = rt_pass;&lt;br /&gt;
$url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/new?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
$request = new HttpRequest($url, HTTP_METH_POST);&lt;br /&gt;
// Note : to add data in custom fields you need to add element like below example&lt;br /&gt;
// in $post_data array&lt;br /&gt;
// Example : \nCF-customfield1:testdata&lt;br /&gt;
$post_data=array(&amp;quot;content&amp;quot;=&amp;gt;&amp;quot;Queue: General\nRequestor: user@domain\nSubject: REST test 1\nOwner: userX\nAdminCc: userX\nText: This is a REST test\n&amp;quot;);&lt;br /&gt;
$request-&amp;gt;addPostFields($post_data);&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
response = $request-&amp;gt;send()-&amp;gt;getBody();&lt;br /&gt;
print_r($response);&lt;br /&gt;
}catch (HttpException $ex) {&lt;br /&gt;
echo $ex;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C# ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Using &amp;quot;WCF REST Starter Kit&amp;quot; (http://msdn.microsoft.com/en-us/netframework/cc950529.aspx)&lt;br /&gt;
using (var client = new HttpClient(&amp;quot;http://rt.site.com/REST/1.0/&amp;quot;))&lt;br /&gt;
{&lt;br /&gt;
   client.TransportSettings.Cookies = new CookieContainer();&lt;br /&gt;
&lt;br /&gt;
   var form = new HttpUrlEncodedForm();&lt;br /&gt;
   form.Add(&amp;quot;user&amp;quot;, &amp;quot;LOGIN&amp;quot;);&lt;br /&gt;
   form.Add(&amp;quot;pass&amp;quot;, &amp;quot;PASSWORD&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
   client.Post(string.Empty, form.CreateHttpContent());&lt;br /&gt;
&lt;br /&gt;
   // 1. Get ticket data&lt;br /&gt;
   using (var request = client.Get(&amp;quot;ticket/1234/show&amp;quot;))&lt;br /&gt;
   {&lt;br /&gt;
      string content = request.Content.ReadAsString();&lt;br /&gt;
      // Some logic&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // 2. Post ticket reply with attachment&lt;br /&gt;
   var formPost = new HttpMultipartMimeForm();&lt;br /&gt;
   byte[] attachment = new byte[];&lt;br /&gt;
   string content = string.Empty;&lt;br /&gt;
         &lt;br /&gt;
   // Store data in attachment&lt;br /&gt;
   // Store data in content string (&amp;quot;Field: Value&amp;quot; line by line)&lt;br /&gt;
   // ...&lt;br /&gt;
         &lt;br /&gt;
   formPost.Add(&amp;quot;content&amp;quot;, content);&lt;br /&gt;
   formPost.Add(&amp;quot;attachment_1&amp;quot;, &amp;quot;attachment_1&amp;quot;, HttpContent.Create(attachment, &amp;quot;application/octet-stream&amp;quot;));&lt;br /&gt;
                             &lt;br /&gt;
   using (var post = client.Post(&amp;quot;ticket/1234/comment&amp;quot;), formPost.CreateHttpContent()))&lt;br /&gt;
      // Some logic&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Powershell (v3)===&lt;br /&gt;
* Escape Powershell reserved chars in user/pass&lt;br /&gt;
* If connecting via SSL, use fqdn of server, not cname&lt;br /&gt;
*Use `n (newline) when composing new ticket structure&lt;br /&gt;
Read RT queue based on query: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$servername=&amp;quot;Your Servername here&amp;quot;&lt;br /&gt;
$u=&amp;quot;user=Username&amp;quot;&lt;br /&gt;
$p=&amp;quot;pass=Password&amp;quot;&lt;br /&gt;
$q=&amp;quot;search/ticket?query=(Status=&#039;open&#039; OR Status=&#039;new&#039;) AND (Queue=&#039;GENERAL&#039; OR Queue=&#039;FOO&#039;) AND Owner=&#039;Nobody&#039;&amp;quot;&lt;br /&gt;
$uri=&amp;quot;https://&amp;quot; + $servername + &amp;quot;/rt/REST/1.0/&amp;quot; + $q + &amp;quot;&amp;amp;&amp;quot; + $u + &amp;quot;&amp;amp;&amp;quot; + $p&lt;br /&gt;
$RT=Invoke-WebRequest -Uri  $uri -SessionVariable sess&lt;br /&gt;
$rt.Content&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===VB.NET===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Public Sub AddAttachmentToRT(ByVal url As String, ByVal fileName As String, ByVal filePath As String)&lt;br /&gt;
&lt;br /&gt;
        Dim dataBoundary As String = &amp;quot;--xYzZY&amp;quot;&lt;br /&gt;
        Dim request As HttpWebRequest&lt;br /&gt;
        Dim fileType As String = &amp;quot;image/jpeg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        &#039;Create a POST web request to the REST interface using the passed URL&lt;br /&gt;
        request = CType(WebRequest.Create(url), HttpWebRequest)&lt;br /&gt;
        request.ContentType = &amp;quot;multipart/form-data; boundary=xYzZY&amp;quot;&lt;br /&gt;
        request.Method = &amp;quot;POST&amp;quot;&lt;br /&gt;
        request.KeepAlive = True&lt;br /&gt;
&lt;br /&gt;
        &#039;Write the request to the requestStream&lt;br /&gt;
        Using requestStream As IO.Stream = request.GetRequestStream()&lt;br /&gt;
&lt;br /&gt;
            &#039;Create a variable &amp;quot;attachment_1&amp;quot; in the POST, specify the file name and file type&lt;br /&gt;
            Dim preAttachment As String = dataBoundary + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Disposition: form-data; name=&amp;quot;&amp;quot;attachment_1&amp;quot;&amp;quot;; filename=&amp;quot;&amp;quot;&amp;quot; + fileName + &amp;quot;&amp;quot;&amp;quot;&amp;quot; + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Type: &amp;quot; + fileType + vbCrLf _&lt;br /&gt;
            + vbCrLf&lt;br /&gt;
&lt;br /&gt;
            &#039;Convert this preAttachment string to bytes&lt;br /&gt;
            Dim preAttachmentBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(preAttachment)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write this preAttachment string to the stream&lt;br /&gt;
            requestStream.Write(preAttachmentBytes, 0, preAttachmentBytes.Length)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write the file as bytes to the stream by passing its exact location&lt;br /&gt;
            Using fileStream As New IO.FileStream(Server.MapPath(filePath + fileName), IO.FileMode.Open, IO.FileAccess.Read)&lt;br /&gt;
&lt;br /&gt;
                Dim buffer(4096) As Byte&lt;br /&gt;
                Dim bytesRead As Int32 = fileStream.Read(buffer, 0, buffer.Length)&lt;br /&gt;
&lt;br /&gt;
                Do While (bytesRead &amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
                    requestStream.Write(buffer, 0, bytesRead)&lt;br /&gt;
                    bytesRead = fileStream.Read(buffer, 0, buffer.Length)&lt;br /&gt;
&lt;br /&gt;
                Loop&lt;br /&gt;
&lt;br /&gt;
            End Using&lt;br /&gt;
&lt;br /&gt;
            &#039;Create a variable named content in the POST, specify the attachment name and comment text&lt;br /&gt;
            Dim postAttachment As String = vbCrLf _&lt;br /&gt;
            + dataBoundary + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Disposition: form-data; name=&amp;quot;&amp;quot;content&amp;quot;&amp;quot;&amp;quot; + vbCrLf _&lt;br /&gt;
            + vbCrLf _&lt;br /&gt;
            + &amp;quot;Action: comment&amp;quot; + vbLf _&lt;br /&gt;
            + &amp;quot;Attachment: &amp;quot; + fileName + vbCrLf _&lt;br /&gt;
            + &amp;quot;Text: Whatever You Want&amp;quot; + vbCrLf _&lt;br /&gt;
            + vbCrLf _&lt;br /&gt;
            + &amp;quot;--xYzZY--&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            &#039;Convert postAttachment string to bytes&lt;br /&gt;
            Dim postAttachmentBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(postAttachment)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write the postAttachment string to the stream&lt;br /&gt;
            requestStream.Write(postAttachmentBytes, 0, postAttachmentBytes.Length)&lt;br /&gt;
&lt;br /&gt;
        End Using&lt;br /&gt;
&lt;br /&gt;
        Dim response As Net.WebResponse = Nothing&lt;br /&gt;
&lt;br /&gt;
        &#039;Get the response from our REST request to RT&lt;br /&gt;
        &#039;Required to capture response, without this Try-Catch attaching will fail&lt;br /&gt;
        Try&lt;br /&gt;
            response = request.GetResponse()&lt;br /&gt;
&lt;br /&gt;
            Using responseStream As IO.Stream = response.GetResponseStream()&lt;br /&gt;
&lt;br /&gt;
                Using responseReader As New IO.StreamReader(responseStream)&lt;br /&gt;
&lt;br /&gt;
                    Dim responseText = responseReader.ReadToEnd()&lt;br /&gt;
&lt;br /&gt;
                End Using&lt;br /&gt;
&lt;br /&gt;
            End Using&lt;br /&gt;
&lt;br /&gt;
        Catch exception As Net.WebException&lt;br /&gt;
&lt;br /&gt;
            response = exception.Response&lt;br /&gt;
&lt;br /&gt;
            If (response IsNot Nothing) Then&lt;br /&gt;
&lt;br /&gt;
                Using reader As New IO.StreamReader(response.GetResponseStream())&lt;br /&gt;
&lt;br /&gt;
                    Dim responseText = reader.ReadToEnd()&lt;br /&gt;
&lt;br /&gt;
                End Using&lt;br /&gt;
&lt;br /&gt;
                response.Close()&lt;br /&gt;
&lt;br /&gt;
            End If&lt;br /&gt;
&lt;br /&gt;
        Finally&lt;br /&gt;
&lt;br /&gt;
            request = Nothing&lt;br /&gt;
&lt;br /&gt;
        End Try&lt;br /&gt;
&lt;br /&gt;
    End Sub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===JavaScript===&lt;br /&gt;
This is an example of updating the RefersTo field for a ticket. Assuming Zepto/jQuery is also being used.&lt;br /&gt;
 function link_back(url, ticket_num, rt) {&lt;br /&gt;
     var data, link;&lt;br /&gt;
     link = &amp;quot;refersto: &amp;quot; + url;&lt;br /&gt;
     data = {&amp;quot;content&amp;quot;: link};&lt;br /&gt;
 &lt;br /&gt;
     $.ajax({&lt;br /&gt;
         type: &amp;quot;POST&amp;quot;,&lt;br /&gt;
         url: rt + ticket_num + &amp;quot;/links&amp;quot;,&lt;br /&gt;
         data: data,&lt;br /&gt;
         success: function (reply) {&lt;br /&gt;
             console.log(reply);&lt;br /&gt;
         }&lt;br /&gt;
     });&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 var url = &amp;quot;https://www.wikipedia.org/&amp;quot;;&lt;br /&gt;
 var ticket_num = &amp;quot;123456&amp;quot;;&lt;br /&gt;
 var rt = &amp;quot;https://some.rt.url/REST/1.0/ticket/&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 link_back(url, ticket_num, rt);&lt;br /&gt;
&lt;br /&gt;
== Convenience libraries ==&lt;br /&gt;
&lt;br /&gt;
There are libraries which do much of the low-level work shown in the examples below for you, and provide an easier programming interface for dealing with RT:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Language&lt;br /&gt;
!Package/Module&lt;br /&gt;
!Source&lt;br /&gt;
!Example&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Perl&#039;&#039;&#039;&lt;br /&gt;
|[http://metacpan.org/module/RT::Client::REST RT::Client::REST]&lt;br /&gt;
|[http://rt-client-rest.googlecode.com/svn/trunk/ Google Code]&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;quot;perl -MCPAN -e install RT::Client::REST&amp;quot;&amp;lt;/code&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Ruby&#039;&#039;&#039;&lt;br /&gt;
|[http://rt-client.rubyforge.org RT-Client]&lt;br /&gt;
|[http://rubygems.org/gems/rt-client RubyGems]&lt;br /&gt;
|&amp;lt;code&amp;gt;gem install rt-client&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Ruby&#039;&#039;&#039;&lt;br /&gt;
|[http://rubygems.org/gems/roart Roart]&lt;br /&gt;
|[https://github.com/pjdavis/roart GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;gem install roart&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/z4r/python-rtkit rtkit]&lt;br /&gt;
|[https://github.com/ GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;pip install python-rtkit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
|[https://gitlab.labs.nic.cz/labs/python-rt python-rt]&lt;br /&gt;
|[https://gitlab.labs.nic.cz GitLab]&lt;br /&gt;
|&amp;lt;code&amp;gt;pip install rt&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Java&#039;&#039;&#039;&lt;br /&gt;
|[http://projects.boksa.de/RT-REST/ RT-REST]&lt;br /&gt;
|[https://github.com/bboksa/RT-REST GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;N/A&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;PHP&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/dersam/RTPHPLib RTPHPLib]&lt;br /&gt;
|[https://github.com/dersam/RTPHPLib GitHub]&lt;br /&gt;
|composer require dersam/rt-php-lib&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=REST&amp;diff=26414</id>
		<title>REST</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=REST&amp;diff=26414"/>
		<updated>2016-10-20T14:52:48Z</updated>

		<summary type="html">&lt;p&gt;Jbrandt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
&lt;br /&gt;
The REST Interface gives you access to your RT Database. The complete communication is encapsulated in the HTTP protocol. The interface should be accessible in your installation.&lt;br /&gt;
&lt;br /&gt;
Though you may see references to older 3.x releases of RT below, Best Practice indicates that the REST stuff has not changed in any significant way in 4.x as of, at least, 1/2012.&lt;br /&gt;
&lt;br /&gt;
[{{SERVER}}/index.php?search={{TALKPAGENAME}}&amp;amp;title=Special:Search Legacy Comments] are available from the previous Wikia instance.&lt;br /&gt;
&lt;br /&gt;
== Interface ==&lt;br /&gt;
&lt;br /&gt;
Base URL: &amp;lt;code&amp;gt;.../REST/1.0/&amp;lt;/code&amp;gt;. The default response should be:&lt;br /&gt;
&lt;br /&gt;
 RT/3.4.5 200 Ok&lt;br /&gt;
                           &lt;br /&gt;
                      # Invalid object specification: &#039;index.html&#039;&lt;br /&gt;
                              &lt;br /&gt;
                      id: index.html&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
The REST Interface does not support HTTP-Authentication. So you must get a valid Session-Token and submit the cookie each request. You usually get a Session-Cookie by submitting the default login form. Use variables &amp;quot;&amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt;&amp;quot; for login and &amp;quot;&amp;lt;code&amp;gt;pass&amp;lt;/code&amp;gt;&amp;quot; for password values. wget doesn&#039;t escape any characters in the --post-data option so make sure you properly escape any special characters in the password.&lt;br /&gt;
&lt;br /&gt;
See the wget invocation line below:&lt;br /&gt;
&lt;br /&gt;
 wget  --keep-session-cookies \&lt;br /&gt;
  --save-cookies cookies.txt \&lt;br /&gt;
  --post-data &#039;user=UUUU&amp;amp;pass=PPPP&#039; \&lt;br /&gt;
  http://my.rt.server&lt;br /&gt;
You need the -keep-session-cookies option to make wget save session cookies.&lt;br /&gt;
&lt;br /&gt;
=== Ticket ===&lt;br /&gt;
&lt;br /&gt;
==== Ticket Properties ====&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single ticket, not including the history and comments.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.4.5 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;&lt;br /&gt;
 Queue: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Owner: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Creator: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Subject: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Status: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Priority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 InitialPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 FinalPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Requestors: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Cc: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 AdminCc: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Created: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Starts: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Started: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Due: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Resolved: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Told: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeEstimated: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeWorked: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 TimeLeft: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Links ====&lt;br /&gt;
&lt;br /&gt;
Gets the ticket links for a single ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links/show&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.2 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&lt;br /&gt;
 HasMember: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 ReferredToBy: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 DependedOnBy: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 MemberOf: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 RefersTo: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
 DependsOn: fsck.com-rt://your.server.com/ticket/&amp;amp;lt;another-id&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachments ====&lt;br /&gt;
&lt;br /&gt;
Gets a list of all attachments related to the ticket&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachment ====&lt;br /&gt;
Gets the metadata and content of a specific attachment.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments/&amp;amp;lt;attachment-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.8.0 200 Ok&lt;br /&gt;
 &lt;br /&gt;
id: &amp;lt;attachment-id&amp;gt;&lt;br /&gt;
Subject:&lt;br /&gt;
Creator: &amp;lt;user-id&amp;gt;&lt;br /&gt;
Created: &amp;lt;timestamp&amp;gt;&lt;br /&gt;
Transaction: &amp;lt;transaction-id&amp;gt;&lt;br /&gt;
Parent: &amp;lt;parent-id&amp;gt;&lt;br /&gt;
MessageId:&lt;br /&gt;
Filename: &amp;lt;filename&amp;gt;&lt;br /&gt;
ContentType: application/octet-stream&lt;br /&gt;
ContentEncoding: none&lt;br /&gt;
 &lt;br /&gt;
Headers: MIME-Version: 1.0&lt;br /&gt;
         X-Mailer: MIME-tools 5.427 (Entity 5.427)&lt;br /&gt;
         Content-Type: application/octet-stream;&lt;br /&gt;
           name=&amp;quot;&amp;lt;filename&amp;gt;&amp;quot;&lt;br /&gt;
         Content-Disposition: inline; filename=&amp;quot;&amp;lt;filename&amp;gt;&amp;quot;&lt;br /&gt;
         Content-Transfer-Encoding: base64&lt;br /&gt;
         Content-Length: &amp;lt;length in bytes&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Content: ...&lt;br /&gt;
         ...&lt;br /&gt;
         ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE: RT returns the content indented with 9 spaces on each line, so that it lines up with the &amp;quot;Content:&amp;quot; header. Even if you strip this out with a regexp, the content is still UTF-8, which is probably not what you want. To get the original binary data back, strip out the 9 spaces with a regexp, strip off the 3 carriage returns at the end, and then convert the whole thing from UTF-8 to the native character encoding of the attachment, whatever that is. RT doesn&#039;t tell you, so you have know. If the attachments were uploaded by a U.S. Windows system, odds are that Windows-1252 is what you want. If you can&#039;t get the binary back intact, see the next method below.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Ticket Attachment Content ====&lt;br /&gt;
&lt;br /&gt;
Gets the attachment data content without additional metadata or whitespace characters&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/attachments/&amp;amp;lt;attachment-id&amp;amp;gt;/content&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.0 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
So to get the original content you still have to strip the first 2 lines of the response.&lt;br /&gt;
&lt;br /&gt;
==== Ticket History ====&lt;br /&gt;
Gets a list of all the history items for a given ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;history-count&amp;gt;/&amp;lt;history-count&amp;gt; (/total)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;history-id&amp;gt;: &amp;lt;history-name&amp;gt;&lt;br /&gt;
&amp;lt;history-id&amp;gt;: &amp;lt;history-name&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get an additional row, for each history entry found. The first entry is usually: &amp;quot;&amp;lt;code&amp;gt;Ticket created by ...&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
There are two ways to get history item detail: you can do one of these and then recursively perform &amp;lt;code&amp;gt;ticket/history/id/&amp;amp;lt;history-id&amp;amp;gt;&amp;lt;/code&amp;gt; for each history-id from this REST call, but that is extremely wasteful and will scale horribly. What you really want to do is one REST call but get the long format:&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history?format=l&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.8.2 200 Ok&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;n&amp;gt;/&amp;lt;n&amp;gt; (id/&amp;amp;lt;history-id&amp;amp;gt;/total)&lt;br /&gt;
&lt;br /&gt;
id: &amp;lt;history-id&amp;gt;&lt;br /&gt;
Ticket: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
TimeTaken: &amp;lt;...&amp;gt;&lt;br /&gt;
Type: &amp;lt;...&amp;gt;&lt;br /&gt;
Field: &amp;lt;...&amp;gt;&lt;br /&gt;
OldValue: &amp;lt;...&amp;gt;&lt;br /&gt;
NewValue: &amp;lt;...&amp;gt;&lt;br /&gt;
Data: &amp;lt;...&amp;gt;&lt;br /&gt;
Description: &amp;lt;...&amp;gt;&lt;br /&gt;
Content: &amp;lt;...&amp;gt;&lt;br /&gt;
Creator: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Created: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attachments:&lt;br /&gt;
             &amp;lt;attachment-id&amp;gt;: &amp;lt;filename&amp;gt; (&amp;lt;size&amp;gt;)&lt;br /&gt;
             &amp;lt;attachment-id&amp;gt;: &amp;lt;filename&amp;gt; (&amp;lt;size&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;n&amp;gt;/&amp;lt;n&amp;gt; (id/&amp;amp;lt;history-id&amp;amp;gt;/total)&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE: the double dash &amp;quot;--&amp;quot; will occur in the long format between each history item. You can split the output on &amp;quot;--&amp;quot; and iterate over it, parsing out the data with an RFC822 parser, such as an email handling library.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Ticket History Entry ====&lt;br /&gt;
Gets the history information for a single history item. Note that the history item must actually correspond to the ticket.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/history/id/&amp;amp;lt;history-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/3.4.5 200 Ok&lt;br /&gt;
&lt;br /&gt;
# 70/70 (id/114856/total)&lt;br /&gt;
&lt;br /&gt;
id: &amp;lt;history-id&amp;gt;&lt;br /&gt;
Ticket: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
TimeTaken: &amp;lt;...&amp;gt;&lt;br /&gt;
Type: &amp;lt;...&amp;gt;&lt;br /&gt;
Field: &amp;lt;...&amp;gt;&lt;br /&gt;
OldValue: &amp;lt;...&amp;gt;&lt;br /&gt;
NewValue: &amp;lt;...&amp;gt;&lt;br /&gt;
Data: &amp;lt;...&amp;gt;&lt;br /&gt;
Description: &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Content: &amp;lt;lin1-0&amp;gt;&lt;br /&gt;
         &amp;lt;line-1&amp;gt;&lt;br /&gt;
         ...&lt;br /&gt;
         &amp;lt;line-n&amp;gt;&lt;br /&gt;
         &lt;br /&gt;
Creator: &amp;lt;...&amp;gt;&lt;br /&gt;
Created: &amp;lt;...&amp;gt;&lt;br /&gt;
Attachments: &amp;lt;...&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IMPORTANT NOTE: At least with RT 3.8.0, when you request a history item with this method AND you have attached a file that has Mime type text/plain to the same item (eg. a comment with an attachement), RT will return the complete content of the attachment for the key &amp;quot;Content:&amp;quot; and not your real comment that you can see in the web frontend. This may lead to some problems if the requestor does not expect to get a comment content that is for example 1.8 MB of text. With other Mime type attachments this however seems to work. I don&#039;t know if this is a feature or a bug.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &#039;&#039;&#039;Ticket Search&#039;&#039;&#039; ====&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=&amp;amp;lt;query&amp;amp;gt;&amp;amp;orderby=&amp;amp;lt;sort-order&amp;amp;gt;&amp;amp;format=&amp;amp;lt;format&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;query&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use any query generated by the query builder - or feel free to write your own. Here an example that will do the following: Find all tickets that have no owner and the status new or open&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;query= Owner = &#039;Nobody&#039; AND ( Status = &#039;new&#039; OR Status = &#039;open&#039; )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: to get all the tickets in &amp;quot;fooQueue&amp;quot; you&#039;d access:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: to get the tickets for a custom field &amp;quot;Contact Name&amp;quot; you&#039;d access:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=&#039;CF.{Contact Name}&#039;=&#039;Shaun Wallace&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;orderby&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By this parameter you can change the sort field and order of the search result. To sort a list ascending just put a + before the fieldname, otherwise a -. Eg: -Created (will put the newest tickets at the beginning).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;amp;orderby=+Created&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;format&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* i: ticket/&amp;amp;lt;ticket-id&amp;amp;gt;&lt;br /&gt;
* s: &amp;amp;lt;ticket-id&amp;amp;gt;: &amp;amp;lt;ticket-subject&amp;amp;gt;&lt;br /&gt;
* l: a multi-line format&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;/REST/1.0/search/ticket?query=Queue=&#039;fooQueue&#039;&amp;amp;orderby=+Created&amp;amp;format=i&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &#039;&#039;&#039;Ticket Create&#039;&#039;&#039; ====&lt;br /&gt;
&lt;br /&gt;
To create a new ticket: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/new&amp;lt;/code&amp;gt; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line, example:&lt;br /&gt;
&lt;br /&gt;
Testing the new ticket section&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: ticket/new&lt;br /&gt;
Queue: &amp;lt;queue name&amp;gt;&lt;br /&gt;
Requestor: &amp;lt;requestor email address&amp;gt;&lt;br /&gt;
Subject: &amp;lt;subject&amp;gt;&lt;br /&gt;
Cc: &amp;lt;...&amp;gt;&lt;br /&gt;
AdminCc: &amp;lt;...&amp;gt;&lt;br /&gt;
Owner: &amp;lt;...&amp;gt;&lt;br /&gt;
Status: &amp;lt;...&amp;gt;&lt;br /&gt;
Priority: &amp;lt;...&amp;gt;&lt;br /&gt;
InitialPriority: &amp;lt;...&amp;gt;&lt;br /&gt;
FinalPriority: &amp;lt;...&amp;gt;&lt;br /&gt;
TimeEstimated: &amp;lt;...&amp;gt;&lt;br /&gt;
Starts: &amp;lt;...&amp;gt;&lt;br /&gt;
Due: &amp;lt;...&amp;gt;&lt;br /&gt;
Text: &amp;lt;The ticket content&amp;gt;&lt;br /&gt;
CF-&amp;lt;CustomFieldName&amp;gt;: &amp;lt;CustomFieldValue&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are any &amp;quot;special&amp;quot; characters (Umlauts, dash, ...?) in a custom field&#039;s name, you can still access it via its ID:&lt;br /&gt;
 CF-$id: &amp;lt;Value&amp;gt;&lt;br /&gt;
If you want to have a multiline Text, prefix every line with a blank.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Due: &amp;lt;...&amp;gt;&lt;br /&gt;
Text: This is &lt;br /&gt;
 a &lt;br /&gt;
 multiline Text&lt;br /&gt;
 !!!&lt;br /&gt;
CF-&amp;lt;CustomFieldName&amp;gt;: &amp;lt;CustomFieldValue&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response should look like: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RT/4.0.6 200 Ok&lt;br /&gt;
&lt;br /&gt;
# Ticket 775 created.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== curl example =====&lt;br /&gt;
    &lt;br /&gt;
  * Create a file containing the ticket form:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: ticket/new&lt;br /&gt;
Queue: queue1&lt;br /&gt;
Requestor: requestor@email&lt;br /&gt;
Priority: 4&lt;br /&gt;
CF-Type of request: Demande&lt;br /&gt;
Subject: Test REST&lt;br /&gt;
Text: Multi line&lt;br /&gt;
 test with&lt;br /&gt;
 special chars: é&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  * Submit using curl:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
curl --data-urlencode content@file.name &#039;https://HOSTNAME/REST/1.0/ticket/new?user=USER&amp;amp;pass=PASSWORD&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Ticket Edit ====&lt;br /&gt;
To update an existing ticket: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/edit&amp;lt;/code&amp;gt; with a variable named &amp;quot;content&amp;quot;, containing &amp;quot;key: value&amp;quot; line by line (like the one displayed when issuing &amp;lt;code&amp;gt;ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;). Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Priority: 5&lt;br /&gt;
TimeWorked: 15&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*PHP&lt;br /&gt;
   &amp;lt;pre&amp;gt; &lt;br /&gt;
                    $username = rt_user;&lt;br /&gt;
                    $password = rt_pass;&lt;br /&gt;
                    $url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/&amp;lt;ticket id&amp;gt;/edit?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
                    $request = new HttpRequest($url, HTTP_METH_POST);&lt;br /&gt;
                    $post_data=array(&amp;quot;content&amp;quot;=&amp;gt;&amp;quot;AdminCc: userX\nText: This is a REST test edit ticket\n&amp;quot;);&lt;br /&gt;
                    &lt;br /&gt;
                    // add the post fields  &lt;br /&gt;
                    $request-&amp;gt;addPostFields($postData);&lt;br /&gt;
                    // response from RT&lt;br /&gt;
                    $response = $request-&amp;gt;send()-&amp;gt;getBody();&lt;br /&gt;
                    print_r($response);&lt;br /&gt;
                    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tickets History Reply ====&lt;br /&gt;
Same as comment: post on &amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/comment&amp;lt;/code&amp;gt; with a variable name &amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
Action: correspond&lt;br /&gt;
Text: the text comment&lt;br /&gt;
Cc: &amp;lt;...&amp;gt;&lt;br /&gt;
Bcc: &amp;lt;...&amp;gt;&lt;br /&gt;
TimeWorked: &amp;lt;...&amp;gt;&lt;br /&gt;
Attachment: an attachment filename/path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Cc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Bcc&amp;lt;/code&amp;gt; are for this reply only (&#039;&#039;I think&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
==== Ticket History Comment ====&lt;br /&gt;
To add a comment to an existing ticket: POST on &amp;quot;&amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/comment&amp;lt;/code&amp;gt;&amp;quot; with a variable name &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
id: &amp;lt;ticket-id&amp;gt;&lt;br /&gt;
Action: comment&lt;br /&gt;
Text: the text comment&lt;br /&gt;
Attachment: an attachment filename/path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Action can be &amp;quot;&amp;lt;code&amp;gt;comment&amp;lt;/code&amp;gt;&amp;quot; or &amp;quot;&amp;lt;code&amp;gt;correspond&amp;lt;/code&amp;gt;&amp;quot;. For a list of fields you can use in correspondence, try &amp;quot;&amp;lt;code&amp;gt;/opt/rt3/bin/rt correspond ticket/1&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your comment contains multiple lines, each new line must be preceded by a space (e.g. &amp;quot;line 1\n line 2&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you want to use HTML replies, use &amp;lt;pre&amp;gt;Content-Type: text/html&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you used &amp;quot;&amp;lt;code&amp;gt;Attachment&amp;lt;/code&amp;gt;&amp;quot;, you must add to your POST a variable &amp;quot;&amp;lt;code&amp;gt;attachment_1&amp;lt;/code&amp;gt;&amp;quot; that contains the raw attachment in multi-part file object.&lt;br /&gt;
&lt;br /&gt;
You can upload more attachments as well, in this case you have to separate the file names in the &amp;quot;&amp;lt;code style=&amp;quot;border-style: initial; border-color: initial; &amp;quot;&amp;gt;Attachment&amp;lt;/code&amp;gt;&amp;quot; with &amp;quot;\n &amp;quot;(a newline and space, without quotes) and add a new variable &amp;quot;attachment_$i&amp;quot; to your POST where $i is the index of attachment.&lt;br /&gt;
&lt;br /&gt;
You need to send header to post comments&lt;br /&gt;
&lt;br /&gt;
==== Ticket Links Edit ====&lt;br /&gt;
To update links on an existing ticket: POST on &amp;quot;&amp;lt;code&amp;gt;/REST/1.0/ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&amp;lt;/code&amp;gt;&amp;quot; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line (like the one displayed when issuing &amp;quot;&amp;lt;code&amp;gt;ticket/&amp;amp;lt;ticket-id&amp;amp;gt;/links&amp;lt;/code&amp;gt;&amp;quot;). Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DependsOn: 54354&lt;br /&gt;
RefersTo: http://some.external/link&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== User Properties ===&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single user.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/user/&amp;amp;lt;user-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.4 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: user/&amp;amp;lt;user-id&amp;amp;gt;&lt;br /&gt;
 Name: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Password: ********&lt;br /&gt;
 EmailAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 RealName: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Organization: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Privileged: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Disabled: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also you can use user login instead of user ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ===&lt;br /&gt;
&lt;br /&gt;
==== User Create ====&lt;br /&gt;
&lt;br /&gt;
To create a new user: post on &amp;lt;code&amp;gt;/REST/1.0/user/new&amp;lt;/code&amp;gt; with a variable named &amp;quot;&amp;lt;code&amp;gt;content&amp;lt;/code&amp;gt;&amp;quot;, containing &amp;quot;&amp;lt;code&amp;gt;key: value&amp;lt;/code&amp;gt;&amp;quot; line by line, like the response to &amp;lt;code&amp;gt;/user/&amp;amp;lt;ticket-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== User Edit ====&lt;br /&gt;
To update an existing user: post on &amp;lt;code&amp;gt;/REST/1.0/user/&amp;amp;lt;user-id&amp;amp;gt;/edit&amp;lt;/code&amp;gt; with a variable named &amp;quot;content&amp;quot;, containing &amp;quot;key: value&amp;quot; line by line (like the one displayed when issuing &amp;lt;code&amp;gt;user/&amp;amp;lt;user-id&amp;amp;gt;/show&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Queue Properties ===&lt;br /&gt;
&lt;br /&gt;
Gets the data for a single queue.&lt;br /&gt;
&lt;br /&gt;
Request: &amp;lt;code&amp;gt;/REST/1.0/queue/&amp;amp;lt;queue-id&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 RT/3.8.4 200 Ok&lt;br /&gt;
 &lt;br /&gt;
 id: queue/&amp;amp;lt;queue-id&amp;amp;gt;&lt;br /&gt;
 Name: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 Description: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 CorrespondAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 CommentAddress: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 InitialPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 FinalPriority: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
 DefaultDueIn: &amp;amp;lt;...&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Logout ===&lt;br /&gt;
&lt;br /&gt;
To logout: post on &amp;lt;code&amp;gt;/REST/1.0/logout&amp;lt;/code&amp;gt; with empty content.&lt;br /&gt;
&lt;br /&gt;
== Types ==&lt;br /&gt;
&lt;br /&gt;
*new&lt;br /&gt;
*open&lt;br /&gt;
*stalled&lt;br /&gt;
*resolved&lt;br /&gt;
*rejected&lt;br /&gt;
*deleted&lt;br /&gt;
+ other custom values defined in you local RT portal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== History entry type ===&lt;br /&gt;
* Create&lt;br /&gt;
* CustomField&lt;br /&gt;
* EmailRecord&lt;br /&gt;
* Status&lt;br /&gt;
* CommentEmailRecord&lt;br /&gt;
* Correspond&lt;br /&gt;
* Comment&lt;br /&gt;
* Priority&lt;br /&gt;
* Give&lt;br /&gt;
* Steal&lt;br /&gt;
* Take&lt;br /&gt;
* Untake&lt;br /&gt;
* AddWatcher&lt;br /&gt;
* DeleteWatcher&lt;br /&gt;
* AddLink&lt;br /&gt;
* DeleteLink&lt;br /&gt;
* AddReminder&lt;br /&gt;
* OpenReminder&lt;br /&gt;
* ResolveReminder&lt;br /&gt;
* Set&lt;br /&gt;
* Force&lt;br /&gt;
* Subject&lt;br /&gt;
* Told&lt;br /&gt;
* PurgeTransaction&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
=== Data format ===&lt;br /&gt;
History entries time returns in UTC, boolean returns as &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; (true) and &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;(false). &lt;br /&gt;
Use only &amp;lt;code&amp;gt;&amp;quot;\n&amp;quot;&amp;lt;/code&amp;gt;, not &amp;lt;code&amp;gt;&amp;quot;\r\n&amp;quot;&amp;lt;/code&amp;gt;in post content. &lt;br /&gt;
Comments in response body starts with &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
#symbol.&lt;br /&gt;
&lt;br /&gt;
=== Request status ===&lt;br /&gt;
To get real request/post status you need to check status code in first line of server response.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Perl ===&lt;br /&gt;
To get the results of a single request (without setting the Session-Cookie) - assuming you&#039;ve set:&lt;br /&gt;
&lt;br /&gt;
* $uri to your RT REST URL&lt;br /&gt;
* $access_user to your username&lt;br /&gt;
* $access_password to your password&lt;br /&gt;
* $ticketNumber to the ticket you want to see&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
my $ua = LWP::UserAgent-&amp;amp;gt;new;&lt;br /&gt;
$ua-&amp;gt;timeout(10);&lt;br /&gt;
$ua-&amp;gt;agent(&amp;quot;YOURUSERAGENTHERE&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
my $response = $ua-&amp;gt;post($uri.&amp;quot;ticket/$ticketNumber&amp;quot;,&lt;br /&gt;
   [&#039;user&#039; =&amp;gt; $access_user, &#039;pass&#039; =&amp;gt; $access_password],&lt;br /&gt;
    &#039;Content_Type&#039; =&amp;gt; &#039;form-data&#039;);&lt;br /&gt;
&lt;br /&gt;
if ($response-&amp;amp;gt;is_success) {&lt;br /&gt;
   print $response-&amp;gt;decoded_content;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import org.apache.commons.httpclient.HttpClient;&lt;br /&gt;
import org.apache.commons.httpclient.methods.PostMethod;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.Part;&lt;br /&gt;
import org.apache.commons.httpclient.methods.multipart.StringPart;&lt;br /&gt;
  &lt;br /&gt;
public class RtTicketCreator {&lt;br /&gt;
   static final String BASE_URI = &amp;quot;http://rt.xxx.com/REST/1.0&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
   public static void main(String[] args) throws IOException {&lt;br /&gt;
 &lt;br /&gt;
      PostMethod mPost = new PostMethod(BASE_URI + &amp;quot;/ticket/new?user=username&amp;amp;amp;pass=password&amp;quot;);&lt;br /&gt;
      Part[] parts = { new StringPart(&amp;quot;content&amp;quot;, &amp;quot;Queue: General\nSubject: 123&amp;quot;) };&lt;br /&gt;
      mPost.setRequestEntity(new MultipartRequestEntity(parts, mPost.getParams()));&lt;br /&gt;
      HttpClient cl = new HttpClient();&lt;br /&gt;
      cl.executeMethod(mPost);&lt;br /&gt;
      System.out.println(mPost.getResponseBodyAsString());&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Java ( Based on new Apache HttpComponents library ) ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
* RT ticket creator based on the current Apache HttpComponents library 4.1.3&lt;br /&gt;
* Created by Koustubha Kale, kmkale at youtility dot in&lt;br /&gt;
*/&lt;br /&gt;
import org.apache.http.HttpEntity;&lt;br /&gt;
import org.apache.http.HttpResponse;&lt;br /&gt;
import org.apache.http.auth.AuthScope;&lt;br /&gt;
import org.apache.http.auth.UsernamePasswordCredentials;&lt;br /&gt;
import org.apache.http.client.HttpClient;&lt;br /&gt;
import org.apache.http.client.methods.HttpPost;&lt;br /&gt;
import org.apache.http.entity.mime.MultipartEntity;&lt;br /&gt;
import org.apache.http.entity.mime.content.StringBody;&lt;br /&gt;
import org.apache.http.impl.client.DefaultHttpClient;&lt;br /&gt;
import org.apache.http.util.EntityUtils;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class NewApacheHttpcomponentsRtTicketCreator {&lt;br /&gt;
&lt;br /&gt;
    public static void main(String[] args) throws Exception {&lt;br /&gt;
        &lt;br /&gt;
        DefaultHttpClient httpclient = new DefaultHttpClient();&lt;br /&gt;
	try {&lt;br /&gt;
            &lt;br /&gt;
            HttpPost httppost = new HttpPost(&amp;quot;http://rt.xxx.com/rt/REST/1.0&amp;quot; +&lt;br /&gt;
                    &amp;quot;/ticket/new?user=username&amp;amp;pass=password&amp;quot;);&lt;br /&gt;
	    StringBody content = new StringBody(&amp;quot;Queue: General\nSubject: 123&amp;quot;);&lt;br /&gt;
	    MultipartEntity reqEntity = new MultipartEntity();&lt;br /&gt;
	    reqEntity.addPart(&amp;quot;content&amp;quot;, content);&lt;br /&gt;
	    httppost.setEntity(reqEntity);&lt;br /&gt;
	    System.out.println(&amp;quot;executing request &amp;quot; + httppost.getRequestLine());&lt;br /&gt;
            HttpResponse response = httpclient.execute(httppost);&lt;br /&gt;
            HttpEntity resEntity = response.getEntity();&lt;br /&gt;
&lt;br /&gt;
            System.out.println(&amp;quot;----------------------------------------&amp;quot;);&lt;br /&gt;
            System.out.println(response.getStatusLine());&lt;br /&gt;
            if (resEntity != null) {&lt;br /&gt;
                System.out.println(&amp;quot;Response content length: &amp;quot; + resEntity.getContentLength());&lt;br /&gt;
            }&lt;br /&gt;
            EntityUtils.consume(resEntity);&lt;br /&gt;
        } finally {&lt;br /&gt;
            try { httpclient.getConnectionManager().shutdown(); } catch (Exception ignore) {}&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import cookielib&lt;br /&gt;
import urllib&lt;br /&gt;
import urllib2&lt;br /&gt;
       &lt;br /&gt;
# creates a cookie for the rtserver with the credentials given at initialization.&lt;br /&gt;
# define your credentials here&lt;br /&gt;
access_user = &#039;your_login&#039;&lt;br /&gt;
access_password = &#039;your_password&#039;&lt;br /&gt;
       &lt;br /&gt;
# here is the RequestTracker URI we try to access&lt;br /&gt;
uri = &#039;http://your-rt-instance.com/REST/1.0/&#039;&lt;br /&gt;
       &lt;br /&gt;
# trying login on rt server&lt;br /&gt;
cj = cookielib.LWPCookieJar()&lt;br /&gt;
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))&lt;br /&gt;
urllib2.install_opener(opener)&lt;br /&gt;
data = {&#039;user&#039;: access_user, &#039;pass&#039;: access_password}&lt;br /&gt;
ldata = urllib.urlencode(data)&lt;br /&gt;
login = urllib2.Request(uri, ldata)&lt;br /&gt;
try:&lt;br /&gt;
   response = urllib2.urlopen(login)&lt;br /&gt;
   print response.read()&lt;br /&gt;
   print &amp;quot;login successful&amp;quot;&lt;br /&gt;
except urllib2.URLError:&lt;br /&gt;
   # could not connect to server&lt;br /&gt;
   print &amp;quot;Not able to login&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ruby ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env ruby&lt;br /&gt;
require &#039;net/http&#039;&lt;br /&gt;
&lt;br /&gt;
user = &#039;username&#039;&lt;br /&gt;
pass = &#039;password&#039;&lt;br /&gt;
uri = URI(&#039;https://rt.example.com/REST/1.0/ticket/123/show&#039;)&lt;br /&gt;
&lt;br /&gt;
req = Net::HTTP::Post.new(uri.path)&lt;br /&gt;
req.set_form_data(&#039;user&#039; =&amp;gt; user, &#039;pass&#039; =&amp;gt; pass)&lt;br /&gt;
&lt;br /&gt;
res = Net::HTTP.start(uri.hostname, uri.port, &lt;br /&gt;
  :use_ssl =&amp;gt; uri.scheme == &#039;https&#039;, &lt;br /&gt;
  :set_debug_output =&amp;gt; $stderr) do |http|&lt;br /&gt;
  http.request(req)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
case res&lt;br /&gt;
when Net::HTTPSuccess, Net::HTTPRedirection&lt;br /&gt;
  # OK&lt;br /&gt;
  puts &amp;quot;HTTP response code:  #{res.code}&amp;quot;&lt;br /&gt;
  puts &amp;quot;HTTP message: #{res.message}&amp;quot;&lt;br /&gt;
  puts &amp;quot;Response:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  res.each do |key,val|&lt;br /&gt;
    puts &amp;quot;#{key} =&amp;gt; #{val}&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  puts &amp;quot;Data:&amp;quot;&lt;br /&gt;
  puts res.body&lt;br /&gt;
else&lt;br /&gt;
  res.value&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PHP ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$username = rt_user;&lt;br /&gt;
$password = rt_pass;&lt;br /&gt;
$url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/&amp;lt;ticket id&amp;gt;/show?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
$request = new HttpRequest($url, HTTP_METH_GET);&lt;br /&gt;
/* if you want&#039;s to pass additional parameters */&lt;br /&gt;
$request-&amp;gt;addQueryData(array());&lt;br /&gt;
$response = $request-&amp;gt;send();&lt;br /&gt;
print_r($response);&lt;br /&gt;
&amp;lt;/pre&amp;gt; OR&amp;lt;pre&amp;gt;&lt;br /&gt;
$username = rt_user;&lt;br /&gt;
$password = rt_pass;&lt;br /&gt;
$url = &amp;quot;http://server.domain.tld/REST/1.0/ticket/new?user=$username&amp;amp;pass=$password&amp;quot;;&lt;br /&gt;
$request = new HttpRequest($url, HTTP_METH_POST);&lt;br /&gt;
// Note : to add data in custom fields you need to add element like below example&lt;br /&gt;
// in $post_data array&lt;br /&gt;
// Example : \nCF-customfield1:testdata&lt;br /&gt;
$post_data=array(&amp;quot;content&amp;quot;=&amp;gt;&amp;quot;Queue: General\nRequestor: user@domain\nSubject: REST test 1\nOwner: userX\nAdminCc: userX\nText: This is a REST test\n&amp;quot;);&lt;br /&gt;
$request-&amp;gt;addPostFields($post_data);&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
response = $request-&amp;gt;send()-&amp;gt;getBody();&lt;br /&gt;
print_r($response);&lt;br /&gt;
}catch (HttpException $ex) {&lt;br /&gt;
echo $ex;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C# ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Using &amp;quot;WCF REST Starter Kit&amp;quot; (http://msdn.microsoft.com/en-us/netframework/cc950529.aspx)&lt;br /&gt;
using (var client = new HttpClient(&amp;quot;http://rt.site.com/REST/1.0/&amp;quot;))&lt;br /&gt;
{&lt;br /&gt;
   client.TransportSettings.Cookies = new CookieContainer();&lt;br /&gt;
&lt;br /&gt;
   var form = new HttpUrlEncodedForm();&lt;br /&gt;
   form.Add(&amp;quot;user&amp;quot;, &amp;quot;LOGIN&amp;quot;);&lt;br /&gt;
   form.Add(&amp;quot;pass&amp;quot;, &amp;quot;PASSWORD&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
   client.Post(string.Empty, form.CreateHttpContent());&lt;br /&gt;
&lt;br /&gt;
   // 1. Get ticket data&lt;br /&gt;
   using (var request = client.Get(&amp;quot;ticket/1234/show&amp;quot;))&lt;br /&gt;
   {&lt;br /&gt;
      string content = request.Content.ReadAsString();&lt;br /&gt;
      // Some logic&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // 2. Post ticket reply with attachment&lt;br /&gt;
   var formPost = new HttpMultipartMimeForm();&lt;br /&gt;
   byte[] attachment = new byte[];&lt;br /&gt;
   string content = string.Empty;&lt;br /&gt;
         &lt;br /&gt;
   // Store data in attachment&lt;br /&gt;
   // Store data in content string (&amp;quot;Field: Value&amp;quot; line by line)&lt;br /&gt;
   // ...&lt;br /&gt;
         &lt;br /&gt;
   formPost.Add(&amp;quot;content&amp;quot;, content);&lt;br /&gt;
   formPost.Add(&amp;quot;attachment_1&amp;quot;, &amp;quot;attachment_1&amp;quot;, HttpContent.Create(attachment, &amp;quot;application/octet-stream&amp;quot;));&lt;br /&gt;
                             &lt;br /&gt;
   using (var post = client.Post(&amp;quot;ticket/1234/comment&amp;quot;), formPost.CreateHttpContent()))&lt;br /&gt;
      // Some logic&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Powershell (v3)===&lt;br /&gt;
* Escape Powershell reserved chars in user/pass&lt;br /&gt;
* If connecting via SSL, use fqdn of server, not cname&lt;br /&gt;
*Use `n (newline) when composing new ticket structure&lt;br /&gt;
Read RT queue based on query: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$servername=&amp;quot;Your Servername here&amp;quot;&lt;br /&gt;
$u=&amp;quot;user=Username&amp;quot;&lt;br /&gt;
$p=&amp;quot;pass=Password&amp;quot;&lt;br /&gt;
$q=&amp;quot;search/ticket?query=(Status=&#039;open&#039; OR Status=&#039;new&#039;) AND (Queue=&#039;GENERAL&#039; OR Queue=&#039;FOO&#039;) AND Owner=&#039;Nobody&#039;&amp;quot;&lt;br /&gt;
$uri=&amp;quot;https://&amp;quot; + $servername + &amp;quot;/rt/REST/1.0/&amp;quot; + $q + &amp;quot;&amp;amp;&amp;quot; + $u + &amp;quot;&amp;amp;&amp;quot; + $p&lt;br /&gt;
$RT=Invoke-WebRequest -Uri  $uri -SessionVariable sess&lt;br /&gt;
$rt.Content&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===VB.NET===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Public Sub AddAttachmentToRT(ByVal url As String, ByVal fileName As String, ByVal filePath As String)&lt;br /&gt;
&lt;br /&gt;
        Dim dataBoundary As String = &amp;quot;--xYzZY&amp;quot;&lt;br /&gt;
        Dim request As HttpWebRequest&lt;br /&gt;
        Dim fileType As String = &amp;quot;image/jpeg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        &#039;Create a POST web request to the REST interface using the passed URL&lt;br /&gt;
        request = CType(WebRequest.Create(url), HttpWebRequest)&lt;br /&gt;
        request.ContentType = &amp;quot;multipart/form-data; boundary=xYzZY&amp;quot;&lt;br /&gt;
        request.Method = &amp;quot;POST&amp;quot;&lt;br /&gt;
        request.KeepAlive = True&lt;br /&gt;
&lt;br /&gt;
        &#039;Write the request to the requestStream&lt;br /&gt;
        Using requestStream As IO.Stream = request.GetRequestStream()&lt;br /&gt;
&lt;br /&gt;
            &#039;Create a variable &amp;quot;attachment_1&amp;quot; in the POST, specify the file name and file type&lt;br /&gt;
            Dim preAttachment As String = dataBoundary + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Disposition: form-data; name=&amp;quot;&amp;quot;attachment_1&amp;quot;&amp;quot;; filename=&amp;quot;&amp;quot;&amp;quot; + fileName + &amp;quot;&amp;quot;&amp;quot;&amp;quot; + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Type: &amp;quot; + fileType + vbCrLf _&lt;br /&gt;
            + vbCrLf&lt;br /&gt;
&lt;br /&gt;
            &#039;Convert this preAttachment string to bytes&lt;br /&gt;
            Dim preAttachmentBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(preAttachment)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write this preAttachment string to the stream&lt;br /&gt;
            requestStream.Write(preAttachmentBytes, 0, preAttachmentBytes.Length)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write the file as bytes to the stream by passing its exact location&lt;br /&gt;
            Using fileStream As New IO.FileStream(Server.MapPath(filePath + fileName), IO.FileMode.Open, IO.FileAccess.Read)&lt;br /&gt;
&lt;br /&gt;
                Dim buffer(4096) As Byte&lt;br /&gt;
                Dim bytesRead As Int32 = fileStream.Read(buffer, 0, buffer.Length)&lt;br /&gt;
&lt;br /&gt;
                Do While (bytesRead &amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
                    requestStream.Write(buffer, 0, bytesRead)&lt;br /&gt;
                    bytesRead = fileStream.Read(buffer, 0, buffer.Length)&lt;br /&gt;
&lt;br /&gt;
                Loop&lt;br /&gt;
&lt;br /&gt;
            End Using&lt;br /&gt;
&lt;br /&gt;
            &#039;Create a variable named content in the POST, specify the attachment name and comment text&lt;br /&gt;
            Dim postAttachment As String = vbCrLf _&lt;br /&gt;
            + dataBoundary + vbCrLf _&lt;br /&gt;
            + &amp;quot;Content-Disposition: form-data; name=&amp;quot;&amp;quot;content&amp;quot;&amp;quot;&amp;quot; + vbCrLf _&lt;br /&gt;
            + vbCrLf _&lt;br /&gt;
            + &amp;quot;Action: comment&amp;quot; + vbLf _&lt;br /&gt;
            + &amp;quot;Attachment: &amp;quot; + fileName + vbCrLf _&lt;br /&gt;
            + &amp;quot;Text: Whatever You Want&amp;quot; + vbCrLf _&lt;br /&gt;
            + vbCrLf _&lt;br /&gt;
            + &amp;quot;--xYzZY--&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            &#039;Convert postAttachment string to bytes&lt;br /&gt;
            Dim postAttachmentBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(postAttachment)&lt;br /&gt;
&lt;br /&gt;
            &#039;Write the postAttachment string to the stream&lt;br /&gt;
            requestStream.Write(postAttachmentBytes, 0, postAttachmentBytes.Length)&lt;br /&gt;
&lt;br /&gt;
        End Using&lt;br /&gt;
&lt;br /&gt;
        Dim response As Net.WebResponse = Nothing&lt;br /&gt;
&lt;br /&gt;
        &#039;Get the response from our REST request to RT&lt;br /&gt;
        &#039;Required to capture response, without this Try-Catch attaching will fail&lt;br /&gt;
        Try&lt;br /&gt;
            response = request.GetResponse()&lt;br /&gt;
&lt;br /&gt;
            Using responseStream As IO.Stream = response.GetResponseStream()&lt;br /&gt;
&lt;br /&gt;
                Using responseReader As New IO.StreamReader(responseStream)&lt;br /&gt;
&lt;br /&gt;
                    Dim responseText = responseReader.ReadToEnd()&lt;br /&gt;
&lt;br /&gt;
                End Using&lt;br /&gt;
&lt;br /&gt;
            End Using&lt;br /&gt;
&lt;br /&gt;
        Catch exception As Net.WebException&lt;br /&gt;
&lt;br /&gt;
            response = exception.Response&lt;br /&gt;
&lt;br /&gt;
            If (response IsNot Nothing) Then&lt;br /&gt;
&lt;br /&gt;
                Using reader As New IO.StreamReader(response.GetResponseStream())&lt;br /&gt;
&lt;br /&gt;
                    Dim responseText = reader.ReadToEnd()&lt;br /&gt;
&lt;br /&gt;
                End Using&lt;br /&gt;
&lt;br /&gt;
                response.Close()&lt;br /&gt;
&lt;br /&gt;
            End If&lt;br /&gt;
&lt;br /&gt;
        Finally&lt;br /&gt;
&lt;br /&gt;
            request = Nothing&lt;br /&gt;
&lt;br /&gt;
        End Try&lt;br /&gt;
&lt;br /&gt;
    End Sub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===JavaScript===&lt;br /&gt;
This is an example of updating the RefersTo field for a ticket. Assuming Zepto/jQuery is also being used.&lt;br /&gt;
 function link_back(url, ticket_num, rt) {&lt;br /&gt;
     var data, link;&lt;br /&gt;
     link = &amp;quot;refersto: &amp;quot; + url;&lt;br /&gt;
     data = {&amp;quot;content&amp;quot;: link};&lt;br /&gt;
 &lt;br /&gt;
     $.ajax({&lt;br /&gt;
         type: &amp;quot;POST&amp;quot;,&lt;br /&gt;
         url: rt + ticket_num + &amp;quot;/links&amp;quot;,&lt;br /&gt;
         data: data,&lt;br /&gt;
         success: function (reply) {&lt;br /&gt;
             console.log(reply);&lt;br /&gt;
         }&lt;br /&gt;
     });&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 var url = &amp;quot;https://www.wikipedia.org/&amp;quot;;&lt;br /&gt;
 var ticket_num = &amp;quot;123456&amp;quot;;&lt;br /&gt;
 var rt = &amp;quot;https://some.rt.url/REST/1.0/ticket/&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 link_back(url, ticket_num, rt);&lt;br /&gt;
&lt;br /&gt;
== Convenience libraries ==&lt;br /&gt;
&lt;br /&gt;
There are libraries which do much of the low-level work shown in the examples below for you, and provide an easier programming interface for dealing with RT:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Language&lt;br /&gt;
!Package/Module&lt;br /&gt;
!Source&lt;br /&gt;
!Example&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Perl&#039;&#039;&#039;&lt;br /&gt;
|[http://metacpan.org/module/RT::Client::REST RT::Client::REST]&lt;br /&gt;
|[http://rt-client-rest.googlecode.com/svn/trunk/ Google Code]&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;quot;perl -MCPAN -e install RT::Client::REST&amp;quot;&amp;lt;/code&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Ruby&#039;&#039;&#039;&lt;br /&gt;
|[http://rt-client.rubyforge.org RT-Client]&lt;br /&gt;
|[http://rubygems.org/gems/rt-client RubyGems]&lt;br /&gt;
|&amp;lt;code&amp;gt;gem install rt-client&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Ruby&#039;&#039;&#039;&lt;br /&gt;
|[http://rubygems.org/gems/roart Roart]&lt;br /&gt;
|[https://github.com/pjdavis/roart GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;gem install roart&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/z4r/python-rtkit rtkit]&lt;br /&gt;
|[https://github.com/ GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;pip install python-rtkit&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
|[https://gitlab.labs.nic.cz/labs/python-rt python-rt]&lt;br /&gt;
|[https://gitlab.labs.nic.cz GitLab]&lt;br /&gt;
|&amp;lt;code&amp;gt;pip install rt&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Java&#039;&#039;&#039;&lt;br /&gt;
|[http://projects.boksa.de/RT-REST/ RT-REST]&lt;br /&gt;
|[https://github.com/bboksa/RT-REST GitHub]&lt;br /&gt;
|&amp;lt;code&amp;gt;N/A&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;PHP&#039;&#039;&#039;&lt;br /&gt;
|[https://github.com/dersam/RTPHPLib RTPHPLib]&lt;br /&gt;
|[https://github.com/dersam/RTPHPLib GitHub]&lt;br /&gt;
|composer require dersam/rt-php-lib&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jbrandt</name></author>
	</entry>
</feed>