all about rt - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/request tracker boot camp...
TRANSCRIPT
![Page 2: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/2.jpg)
Today’s agenda
• Introductions
• RT History
• Getting up and running
• Point-and-click configuration
• How to customize RT
• Customizing the web interface
• Data Model
• Internationalization
• Reporting
• Approvals and workflow
• Authentication
• Debugging
![Page 3: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/3.jpg)
Hi, I’m Jesse Vincent.
![Page 4: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/4.jpg)
Introduction
![Page 5: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/5.jpg)
Ways RT Gets Used
• Helpdesk
• Network operations
• Bug tracking
• Customer service
• Project management
![Page 6: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/6.jpg)
The RT Layer Cake
![Page 7: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/7.jpg)
A Brief History of RT
![Page 8: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/8.jpg)
8
RT 0.9 (1996)!
• Designed for use at a single company
• 2 sysadmins
• 30 users
![Page 9: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/9.jpg)
9
RT 1.0 (1999)!
• Same as RT 0.9
• (+ a bit more courage)!
• Used at hundeds of companies
• Dozens of CSRs
• Thouands of requests per day
• Intense guilt
![Page 10: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/10.jpg)
10
RT 2.0 (2001)!
• Total rewrite
• Just after Jesse escaped Microsoft
• DBIx::SearchBuilder
– Abstraction
– Multiple DBs supported
• Whole new UI
– No more frames
• “Keywords”
![Page 11: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/11.jpg)
11
RT 3.0 (2003)!• Overhauled web interface
• Extension mechanisms
• Internationalization
• Custom fields
• Cleaner internals
• Tests
![Page 12: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/12.jpg)
12
RT 3.2 (2004)!• New search UI
• Spreadsheet / RSS output
• Outgoing mail preview and logging
• UI improvements
• Attributes for random metadata
• No major structural changes
• More tests
![Page 13: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/13.jpg)
13
RT 3.4 (2005)!• Reimplemented Custom Fields
– Custom fields on users, groups transactions
• Generalized Transaction system
• Faster, Faster, Faster
• Prettier
• Even more tests
![Page 14: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/14.jpg)
14
RT 3.6 (2006)!• All CSS layout and styling
• Customizable homepage
• Built in charts and reports
• Ticket "reminders"
• Comprehensive test coverage
• Cleaner code
![Page 15: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/15.jpg)
15
RT 3.8 (2008)!• More user preferences
– Timezones
– Theme
– Ticket history order
• New configuration system
• Internals cleanup
• Even more tests
• PGP support
![Page 16: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/16.jpg)
RT 3.8 (continued)!
• “Favorite” tickets
• Ticket relationship graphs
• Branded queues
• iCal feeds
• Dashboards
![Page 17: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/17.jpg)
RT 4.0!
The future
![Page 18: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/18.jpg)
RT 4.0
• Never trust a software vendor who talks about the
future...
![Page 19: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/19.jpg)
19
Setting up RT
Download and
Install
![Page 20: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/20.jpg)
Getting up and
running
![Page 21: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/21.jpg)
Download and Install
• Latest Tarball
• http://download.bestpractical.com/pub/rt/
release/rt.tar.gz
• Subversion repository
• svn co svn://svn.bestpractical.com/rt/3.8/trunk
rt-3.8
• Dependencies from CPAN
• Instructions in README
![Page 22: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/22.jpg)
The quick start guide
• wget http://download.bestpractical.com/pub/rt/
release/rt.tar.gz
• tar xzvf rt.tar.gz
• cd rt-3.8.1
• ./configure
• make fixdeps install initdb
![Page 23: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/23.jpg)
File System Layout (I)!
• By default, RT installs everything in /opt/rt3/
• lib/
• RT's perl libraries and message catalogs
• etc/
• RT's configuration files and database schema
• bin/
• Mail gateway, Mason handler and cron tool
• sbin/
• Database setup and dependency checking tools
![Page 24: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/24.jpg)
File System Layout (II)!
• share/html/
• RT's HTML::Mason frontend
• var/
• Mason and web data cache
• local/{html,lib,po}/
• Local components which override or enhance the
core
![Page 25: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/25.jpg)
Configuring RT
Point and Click
![Page 26: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/26.jpg)
The RT Layer Cake
![Page 27: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/27.jpg)
Custom Fields
![Page 28: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/28.jpg)
Custom Fields
• Helpdesk
• Hostname, OS, Browser, Site
• Bug Tracking
• Severity, OS, Category, "Broken In", "Fixed In"
• Property Rental Requests
• Smoking?, Beds, Pets, Special Needs
![Page 29: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/29.jpg)
Custom Field Types
• Select from a List
• Enter Text
• Combobox
• Freeform
• WikiText
• Images
• File Attachments
• AJAX Source
![Page 30: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/30.jpg)
Scrips
![Page 31: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/31.jpg)
Scrips
• Condition / Action / Template
• Scrip Ideas:
• OnCreate NotifyManager
WithTemplate:ManagerNotify
• OnResolve NotifyRequestor
WithTemplate:HappynessSurvey
• OnOwnerChange NotifyOwner
WithTemplate:AssignmentNotifyWithHistory
• OnCreate NotifyRequestor
WithTemplate:SelfServiceNewPasswd
![Page 32: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/32.jpg)
Conditions
• On Create
• On Transaction
• On Correspond
• On Comment
• On Status Change
On Owner ChangeOn Queue Change
On ResolveUser Defined
![Page 33: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/33.jpg)
Actions
• AutoReply
• Notify Requestors
• Notify Owner
• Notify AdminCCs as Comment
• Notify Requestors and CCs
• Notify Requestors, CCs, and Admin CCs
• Notify Other Recipients
• Create Tickets
• Open Tickets
• … as Comment
• User Defined
![Page 34: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/34.jpg)
Templates
• Blank
• AutoReply
• Transaction
• Correspondence
• Comment
• Status Change
• Resolved
• User Defined
![Page 35: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/35.jpg)
Customized Scrips
• Custom Actions, Templates, and Conditions
• In Database
• On Disk
• Flexibility
• Perl
• RT's objects
![Page 36: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/36.jpg)
Custom Templates
• Templates are Text::Template Objects
• They can be plain text
• They can contain Perl
• They are not sandboxed
• Customizing the AutoReply
![Page 37: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/37.jpg)
Customizing the Autoreply
From: { $Transaction->CreatorObj->RealName } (via RT)
<{ $Ticket->QueueObj->CorrespondAddress || $RT::CorrespondAddress }>
Precedence: normal
Mail-Followup-Tuo: [email protected]
Reply-To: [email protected]
# New Ticket Created by { $Transaction->CreatorObj->RealName }
# Please include the string: [{$rtname} #{$Ticket->id}]
# in the subject line of all future correspondence about this issue.
# <URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id} >
{$Transaction->Content()}
![Page 38: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/38.jpg)
Template Tweaks
• $Ticket, $Transaction
• $Ticket->QueueObj,
$Transaction->CreatorObj
• Message Headers
• {$Transaction->Message->First->Headers}
• Real Code:
Thanks for contacting FooCorp Support!
It's { use LWP::Simple; get("http://foocorp/weatherword"); } here in
SomeCity today, but that won't stop us from answering your question within
48 business hours...
![Page 39: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/39.jpg)
Custom Condition
• Code snippet that returns true or false
• Controls whether an action is run
• For example:
• OnEmergency
if ($self->TransactionObj->Subject =~ /emergency/i
&& $self->TicketObj->Transactions->Count == 1) {
1;
} else {
0;
}
![Page 40: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/40.jpg)
Custom Action• PageSysadmins
• Prepare
• Cleanup/Commit
use Net::SMS;
my $sms = Net::SMS->new();
$sms->msgPin("+1 555 123 1234");
$sms->msgFrom("RT");
$sms->msgText($self->TemplateObj->MIMEObj->body->as_string);
$sms->msgSend() !
my $hour = (localtime)[2];
if ($hour > 8 && $hour < 18) {
return 0;
} else {
return 1;
}
![Page 41: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/41.jpg)
Example One
• EmergencyPage Template
• Putting it All Together:
• OnEmergency PageSysadmins
WithTemplate:EmergencyPage
Subject: 911
{$Ticket->Subject}
![Page 42: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/42.jpg)
Example Two
• OnCreate EscalatePriorityIfBoss WithTemplate:Blank
• EscalatePriorityIfBoss Action:
• Prepare
• Commit
$self->TicketObj->SetPriority(99);
($self->TransactionObj->CreatorObj->EmailAddress
=~ /president\@whitehouse.gov/i) ? 1 : 0;
![Page 43: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/43.jpg)
Scrips limited to Queues
• Create a global ScripAction
On Create where Queue is parrot or perl5
• Condition: User Defined
• Custom Condition Code:my $self = shift;
if ($self->TransactionObj->Type eq "Create"
&& $self->TicketObj->QueueObj->Name =~ /^(?:parrot|perl5)$/)
{
return 1;
} else {
return 0;
}
![Page 44: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/44.jpg)
Basic Custom Views
![Page 45: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/45.jpg)
Saved Searches
• Any query
• Any output format
• Personal or Shared
![Page 46: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/46.jpg)
Custom Homepage
• Users can customize their own
• Superusers can change the default
• Pre-written portlets
• Any saved search
• Graphs and Charts (from 3.6.3)
![Page 47: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/47.jpg)
Dashboards
• Similar to custom homepages
• Shareable with groups
• Bookmarkable URLs
• Scheduled email delivery
![Page 48: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/48.jpg)
The Mail Gateway
Letting your users open and update
tickets from their email clients.
![Page 49: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/49.jpg)
The RT Layer Cake
![Page 50: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/50.jpg)
The Mail Gateway
• Usually lives in /opt/rt3/bin
• Simple perl script
• Uses HTTP (or HTTPS) to talk to RT
• Uses REST interface to talk to RT
• Does no message processing
• Doesn't need to run on an RT server
• Doesn't need the rest of RT installed
• Doesn't need to be SetUID or SetGID
![Page 51: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/51.jpg)
How It Works
• MTA pipes message to rt-mailgate
• On any system error, rt-mailgate returns a
"Temporary Failure" error to the MTA
• rt-mailgate sends message to RT Server via HTTP
• Server processes message and creates or updates
ticket
• Server returns a success or failure message
![Page 52: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/52.jpg)
Setting Up the Mail Gateway
/etc/aliases
rt: "|/opt/rt3/bin/rt-mailgate
--url http://localhost/
--queue general
--action correspond"
![Page 53: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/53.jpg)
Debugging rt-mailgate
# /opt/rt3/bin/rt-mailgate \
--url http://localhost/ \
--queue general \
--debug \
--action correspond < /tmp/msg
/tmp/msg:
From: root@localhost
Subject: just testing
This is a message
![Page 54: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/54.jpg)
Advanced Options
• MTAs support "+ notation" to pass information to
MUAs by appending +data to an email address.
• --extension
• 'queue'
• 'ticket'
• 'action'
![Page 55: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/55.jpg)
Mail Extensions
• RT::Extension::
• CommandByEmail
• ExtractSubjectTagOnTransaction
![Page 56: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/56.jpg)
Mail Handling Backend
• RT::Interface::Email
• Routines for parsing and processing mail
• Mail handling plugins
• Filters
• Plugins to modify messages before they're
handed off for processing
• Authentication handlers
• Plugins to decide if the sender of a message is
who they claim to be
![Page 57: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/57.jpg)
Mail Handling Backend
• RT::EmailParser
• Turns a MIME message into a MIME::Entity
![Page 58: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/58.jpg)
Client Side Spam Filtering
• SpamAssassin + procmail
• simple, you may already know how to do this
• SpamAssassin + Mail::Audit
• more flexible
• Dspam
• Web GUI for managing spam trap
• Whitelisting tools
![Page 59: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/59.jpg)
Server Side Spam Filtering
• Using RT::Interface::Email::Filter plugins
• Advantages
• Runs inside the RT core
• Disadvantages
• Current API doesn't provide much
functionality to change message processing
• Runs inside the RT core
![Page 60: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/60.jpg)
Self Service
Let your users help you do your job
![Page 61: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/61.jpg)
Self Service
• RT provides a "SelfService" interface for end-users
• Automatically displayed for unprivileged users
• See new/open/stalled/resolved tickets
• Create new tickets
• Password needed to access it
• Use external authentication for RT
• Send users their passwords when they first
create a ticket
![Page 62: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/62.jpg)
Autoreply with a password
{if (($Transaction->CreatorObj->id != $RT::Nobody->id) &&
(!$Transaction->CreatorObj->Privileged) &&
($Transaction->CreatorObj->__Value('Password') eq '*NO-PASSWORD*')){
my $user = RT::User->new($RT::SystemUser);
$user->Load($Transaction->CreatorObj->Id);
my ($stat, $pass) = $user->SetRandomPassword();
if (!$stat) {
$OUT .="An internal error has occurred. RT was not able to set a
password for you. Please contact your local RT administrator for
assistance.";
}
$OUT .= "You can check the current status and history of your requests
at: ".$RT::WebURL."When prompted, enter the following username and
password: Username: ".$user->Name." Password: ".$pass."";
}}
![Page 63: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/63.jpg)
The RT Commandline
![Page 64: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/64.jpg)
The RT Layer Cake
![Page 65: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/65.jpg)
The RT CLI
• Simple perl script
• Usually lives in /opt/rt3/bin
• Can run locally or remotely
• Uses HTTP (or HTTPS) !
• Uses TicketSQL for Searching
• Talks to RT's "REST" interface
• Scriptable
![Page 66: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/66.jpg)
bin/rt
rt ls "Priority > 5 and Status='new'"
rt ls "queue='perl5' and (Status='new' or
Status='open')"
rt edit ticket/312 set queue=spam status=deleted
rt comment -m 'this is a comment' 151
![Page 67: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/67.jpg)
bin/rt + your shell
rtresolve() {
rt edit ticket/$1 set status=resolved
}
$ rtresolve 551
![Page 68: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/68.jpg)
Hacking the code
Not everything is point and click
![Page 69: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/69.jpg)
I'll just make my changes on the live RT, right?
• Wrong!
• Use a development environment
• Isolate your changes
• Test your changes
• Give your users a break
![Page 70: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/70.jpg)
Set up a development environment
• Download
• Configure
• Run
• Hack
• Run
• Hack
• Run
![Page 71: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/71.jpg)
Setting up a development environment
$ ./configure --with-my-user-group
--enable-layout=inplace
--with-db-type=SQLite
--with-devel-mode
$ make install
$ ./bin/standalone_httpd 8888
![Page 72: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/72.jpg)
What all that means
• Use the SQLite database engine
• One file
• Self-contained
• Install in the build directory
• Keep the permissions as me
• Enable RT's "Developer Mode"
• Run on port 8888
![Page 73: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/73.jpg)
standalone_httpd
• RT Application Server
• Just like mod_perl or FastCGI
• Pure perl
• Can be easily profiled
• Can be run under perl's debugger
![Page 74: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/74.jpg)
“Developer Mode”
• Primarily useful for web development
• Mason refreshes on the fly
• Components (Web UI bits)!
• Perl Libraries
![Page 75: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/75.jpg)
Basic development hints
• Use revision control
• Set up a development environment
• Document what you do
• Collaborate with others on rt-devel
• Use the wiki
http://wiki.bestpractical.com/
![Page 76: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/76.jpg)
Customizing the
Web InterfaceSomething to do with that new
development environment.
![Page 77: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/77.jpg)
The RT Layer Cake
![Page 78: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/78.jpg)
Mason application server
• RT's web interface is built in
HTML::Mason
• Easy to start hacking on,
especially if you know perl
• Fast
• Flexible
![Page 79: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/79.jpg)
A brief introduction to HTML::Mason
• % lines mean “Perl”
• % my $user = RT::User->new(...);
• <% %> tags mean “Perl”
• <% 1+ 1 %>
• <& &> is how Mason includes other templates
• <& /Elements/Header,
• Title => 'Hi!' &>
![Page 80: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/80.jpg)
<%args>
$variable => 'Default value'
</%args>
<h1>This is a page!</h1>
<%init>
# This block runs before any page output
</%init>
<h1> This is page content, too</h1>
Mason Blocks
![Page 81: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/81.jpg)
A Simple Web Tool
<%init>
my $tix = new RT::Tickets($session{'CurrentUser'});
$tix->Limit(FIELD => 'Owner',
VALUE => $session{'CurrentUser'}->id);
</%init>
<h1><&|/l&>All my tickets</&></h1>
% while (my $ticket = $tix->Next) {
<%$ticket->id%>: <%$ticket->Subject%>
<%loc($ticket->Status)%><br>
% }
![Page 82: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/82.jpg)
Custom Mason Templates
• RT puts templates in share/html/
• Find the template you want to change
• Copy it to local/html/
• Make your changes
![Page 83: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/83.jpg)
Custom Mason Templates
• Replace entire Mason component
• Never clobber the core
• Easier to find your changes
• Easier to upgrade RT
![Page 84: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/84.jpg)
/Ticket/Elements/ShowBasics
% if ($Ticket->TimeEstimated) {
<tr>
<td class="label time estimated"><&|/l&>Estimated</&>:</td>
<td class="value time estimated"><& ShowTime, minutes => $Ticket-
>TimeEstimated &></td>
</tr>
% }
% if ($Ticket->TimeWorked) {
<tr>
<td class="label time worked"><&|/l&>Worked</&>:</td>
<td class="value time worked"><& ShowTime, minutes => $Ticket-
>TimeWorked &></td>
</tr>
% }
Example Customization
![Page 85: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/85.jpg)
/Ticket/Elements/ShowBasics
% # if ($Ticket->TimeEstimated) {
<tr>
<td class="label time estimated"><&|/l&>Estimated</&>:</td>
<td class="value time estimated"><& ShowTime, minutes => $Ticket-
>TimeEstimated &></td>
</tr>
% # }
% # if ($Ticket->TimeWorked) {
<tr>
<td class="label time worked"><&|/l&>Worked</&>:</td>
<td class="value time worked"><& ShowTime, minutes => $Ticket-
>TimeWorked &></td>
</tr>
% # }
Example Customization
![Page 86: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/86.jpg)
Cascading Style Sheets
• /NoAuth/css/3.5-default/main.css
• /NoAuth/css/3.4-compat/main.css
• Colors
• Fonts
• Alignment
• Just a Mason component
• Make your own and @import a base one.
• $RT::WebDefaultStylesheet
![Page 87: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/87.jpg)
RT Web Callbacks
• Insert Mason code inside at hook points
• Add things to pages and menus
• Set widget content
• ...all without changing core RT code
![Page 88: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/88.jpg)
How Callbacks Work
• Hooks in the Mason templates that let you add
custom components
• In html/Ticket/Update.html: <& /Elements/Callback,
_CallbackName => 'AfterTitle', %ARGS &>
• Local code "registers" itself by living in the right
place in the filesystem
• RT includes all components matching: {share,local}/html/Callbacks/*/
Ticket/Update.html/AfterTitle
![Page 89: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/89.jpg)
RT::Extension::MenubarSearches
• Small example of callbacks
• Jump to active tickets in each queue
• Inserts a menu item with a callback
![Page 90: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/90.jpg)
rt.cpan.org
![Page 91: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/91.jpg)
Extensions
• RT::BugTracker
• RT::BugTracker::Public
• RT::Extension::rt_cpan_org
• RT::Authen::PAUSE
• RT::Authen::Bitcard
• RT::Authen::OpenID
![Page 92: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/92.jpg)
MasonX::Profiler
Figuring out how the Web UI fits
together
![Page 93: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/93.jpg)
MasonX::Profiler
Foundry/Home/MyRequests.html BEGINS
/Elements/SetupSessionCookie 0.0610
/Callbacks/Foundry/autohandler/Auth 0.0003
/Elements/Callback 0.0242
/Elements/Callback 0.0016
/Foundry/Elements/Top 0.0604
/Foundry/Elements/Tab 0.0194
/Foundry/Elements/Header 0.1375
/Foundry/Elements/Tabs 0.0037
/Elements/Callback 0.0294
/Elements/Footer 0.0308
/autohandler 2.9179
/Foundry/Home/MyRequests.html ENDS
![Page 94: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/94.jpg)
Activating MasonX::Profiler
RT_SiteConfig.pm
use MasonX::Profiler;
@MasonParameters = (
preamble => 'my $p =
MasonX::Profiler->new($m,$r);'
);
![Page 95: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/95.jpg)
The RT Data Model
![Page 96: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/96.jpg)
The RT Layer Cake
![Page 97: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/97.jpg)
Database
• RT is composed of over a dozen types of related
objects
• Building your own relational database out of BDB or
flat files on disks isn't our idea of fun
• Organizations want to be able to use their own tools
to query RT
• RT connects to a SQL backend with an object-
relational mapper
![Page 98: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/98.jpg)
Schema– Core (I)!
• Users
• An individual who can perform actions within RT
• Groups
• A collection of Users and other Groups
• Can be assigned rights, made watchers of tickets, etc
• Principals
• An abstraction of Users and Groups
• Used internally so that anything that can apply to a user
or group can apply to either
![Page 99: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/99.jpg)
Schema– Core (II)!
• GroupMembers
• A listing of all the Users and Groups which are members
of a Group
• CachedGroupMembers
• An internal cache of all members of each group, fully
unrolling the GroupMembers of each GroupMember
• ACL
• A table detailing which rights each Principal has for any
ACLed object in RT
• ACLed Objects include: Ticket, Queue and Group
![Page 100: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/100.jpg)
Schema– Core (III)!
• Links
• A mapping between RT internal objects and other RT
internal objects
• Can handle mapping between any two URIs
• Transactions
• Records of object updates. Usually tickets.
• Attachments
• Any message body or attachment for a Transaction
• Hierarchical, so MIME email messages can be rebuilt
![Page 101: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/101.jpg)
Schema– Core (IV)!
• CustomFields
• Single or multiple values
• Select from list, freeform or file upload
• ObjectCustomFields
• Map CustomFields to Tickets, Transactions, Users, Groups
• CustomFieldValues
• Acceptable values for "select from list" custom fields
• ObjectsCustomFieldValues
• Values of custom fields for specific records
![Page 102: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/102.jpg)
Schema– Core (V)!
• Attributes
• Non searchable metadata
• Can apply to any object (or row)!
![Page 103: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/103.jpg)
Schema– Ticketing (I)!
• Tickets
• Issues of one sort or another
![Page 104: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/104.jpg)
Schema– Ticketing (II)!
• Queues
• Highest level categorization of tickets
• Per queue Scrips, Custom Fields and ACLs
• Scrips
• Conditional actions that can happen on any ticket update
• Templates
• Simple templates which can take embedded perl
expressions
• Used by Scrips
![Page 105: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/105.jpg)
Schema– Ticketing (III)!
• ScripActions
• Used by Scrips to perform some action
• Autorepy to Requestor
• Notify Owner
• Page Systems Administrators
• ScripConditions
• Used by Scrips to decide when to fire
• On Create
• On Correspond
• If message matches "explosion"
![Page 106: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/106.jpg)
Schema Diagram
![Page 107: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/107.jpg)
Working with
your data
![Page 108: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/108.jpg)
Writing directly to the database is wrong
• RT is a complex application with complex
relationships between database tables
• Querying the database for reporting is
sometimes OK, but usually unnecessary
• We've got a better way…
![Page 109: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/109.jpg)
DBIx::SearchBuilder
• It's an object-relational mapper
• It hides SQL from your application
• It lets you transparently treat your database as
perl objects
• Most RT objects are subclasses of
DBIx::SearchBuilder or
DBIx::SearchBuilder::Record
• It's a dessert topping and a floor wax
![Page 110: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/110.jpg)
SearchBuilder is Easy
$t = new RT::Ticket( $RT::SystemUser );
$t->Load( 42 );
print $t->Subject;
![Page 111: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/111.jpg)
Two kinds of object
• DBIx::SearchBuilder
• Collections
• perldoc DBIx::SearchBuilder
• DBIx::SearchBuilder::Record
• Individual records
• perldoc DBIx::SearchBuilder::Record
![Page 112: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/112.jpg)
Record Objects
Create
my $user = RT::User->new($RT::SystemUser);
($id, $msg) = $user->Create(Name => 'jrv', EmailAddress =>
Load
$user->LoadByCols(EmailAddress => '[email protected]');
Read
print $user->Name;
Update
$user->SetName('jesse');
Delete
$user->Delete();
![Page 113: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/113.jpg)
Collection Objects
•Every record has a corresponding DBIx::SearchBuilder
'collection' object
•Complex searches without raw SQL
my $users = RT::Users->new($RT::SystemUser);
$users->Limit(FIELD => 'EmailAddress',
OPERATOR => 'LIKE', VALUE => 'fsck.com');
while (my $user = $users->Next) {
print "Found ",$user->EmailAddress,"\n";
}
![Page 114: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/114.jpg)
Collection Objects
• The standard methods:
• Limit a result set
• Limit();
• Iterate
• Next();
• Sort and Order
• OrderBy();
• Page
• RowsPerPage();
![Page 115: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/115.jpg)
The RT Core Objects
• DBIx::SearchBuilder::Record subclasses
• Ticket
• Queue
• User
• Group
• And others
• ACE, Attachment, Attribute, GroupMember,
Transaction, Principal, Link, CustomField,
CustomFieldValue, ObjectCustomFieldValue, …
![Page 116: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/116.jpg)
API
• RT's API is its core objects
• All RT tools use the same API we export to the world
• rt-crontool
• Web frontend
• Database setup tools
![Page 117: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/117.jpg)
Boilerplate Code
Simple samples
![Page 118: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/118.jpg)
RT Tool Boilerplate
#!/usr/bin/perl -w
use strict;
use lib qw(/opt/rt3/local/lib /opt/rt3/lib);
use RT;
# Load the config file
RT::LoadConfig();
# Connect to the database and get RT::SystemUser
# loaded
RT::Init();
![Page 119: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/119.jpg)
Resolve a ticket
[...boilerplate...]
use RT::Interface::CLI qw(GetCurrentUser loc);
use RT::Ticket;
my $CurrentUser = GetCurrentUser();
die loc("No RT user found.")
unless ($CurrentUser->Id);
my $ticketid = shift @ARGV;
my $ticket = RT::Ticket->new($CurrentUser);
$ticket->Load($ticketid);
die loc("Ticket not found") unless ($ticket->Id);
my ($trans, $msg) = $ticket->SetStatus('resolved');
print $msg;
![Page 120: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/120.jpg)
Overlay Classes
Cleanly customize core classes
![Page 121: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/121.jpg)
Overlay and Local Classes
• Core database-access classes are
auto-generated
• When the database changes, you don't want to
hand-hack code
• When you make changes to RT, you want your
changes to persist seamlessly across minor version
upgrades
• Most sites don't track local source changes
• Even if they do, merging sucks
![Page 122: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/122.jpg)
How Overlays work
# User_Local.pm
no warnings qw/redefine/;
package RT::User;
use Site::UserDB;
sub RealName {
my $self = shift;
return Site::UserDB::LookupName(
$self->EmailAddress);
}
![Page 123: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/123.jpg)
How Overlays work
eval "require RT::Ticket_Overlay";
if ($@ && $@ !~ qr{^Can't locate RT/Ticket_Overlay.pm}) {
die $@;
};
eval "require RT::Ticket_Vendor";
if ($@ && $@ !~ qr{^Can't locate RT/Ticket_Vendor.pm}) {
die $@;
};
eval "require RT::Ticket_Local";
if ($@ && $@ !~ qr{^Can't locate RT/Ticket_Local.pm}) {
die $@;
};
![Page 124: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/124.jpg)
Principals and
Users and GroupsOh my!
![Page 125: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/125.jpg)
Principals,Users and Groups
• Principals
• Every User is a Principal
• Every Group is a Principal
• We can treat users and groups as equivalent for
ACL checks and Group Membership
• Groups can contain users and groups
• Groups can't contain themselves
![Page 126: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/126.jpg)
Authentication
• RT has its own internal authentication system
• RT needs to have a user object for any user before
they're allowed to access RT
• You can tie RT into your single sign on
• RT::Authen::
• Bitcard
• OpenID
![Page 127: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/127.jpg)
ACL System
• ACLs can apply to any DBIx::SB::Record
• Any Record object type can define what rights it
supports
• Rights can be granted to any user or group
• Other systems that drop on top of RT can use the
ACL system
![Page 128: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/128.jpg)
Delegation
• Supports basic delegation of rights
• Doesn't support "partial" delegation of a given right
• Doesn't support "re-delegation of rights"
• When a user's right to do something is revoked,
delegates also have right revoked
![Page 129: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/129.jpg)
I18N and L10N
Internationalization and Localization
![Page 130: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/130.jpg)
Internationalization
I18N
![Page 131: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/131.jpg)
Building Blocks
• UTF8/Unicode
• Locale::MakeText
• Locale::MakeText::Lexicon
![Page 132: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/132.jpg)
Overview
• Write Code
• Extract Strings to Message Catalog
• Translate Message Catalog
![Page 133: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/133.jpg)
String Extraction
• Core
• $self->loc("Created ticket [_1]", $ticket->Id);
• Code In Mason
• loc("Created ticket [_1]", $ticket->Id);
• Text In Mason
• <&|/l, $ticket->Id&>Created ticket [_1]</&>
• Getting the strings into the .po files
• tool/extract-message-catalog
![Page 134: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/134.jpg)
Localization
L10N
![Page 135: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/135.jpg)
Adding a New Translation
• Basic localization for languages without cases/
aspects
• Extract a fresh .po file
• Translate .po file
• Example string from nl.po file
• #: html/Admin/Users/Modify.html:80
• msgid "Access control"
• msgstr "Toegangscontrole"
• Check your work
![Page 136: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/136.jpg)
Gotchas
![Page 137: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/137.jpg)
All languages are not created equal
• "1 Ticket(s) found" is ugly and wrong
• Handling this case is language specific
• English treats singular and plural separately
• Some languages treat zero specially
• Some languages have a "dual"
• Locale::Maketext::Lexicon lets you use perl to help
your translations.
![Page 138: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/138.jpg)
![Page 139: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/139.jpg)
![Page 140: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/140.jpg)
Corporatization
• Localization can be useful just within an
organization.
• Every organization has its own jargon
• It's a "request", not a "ticket"
• PO files can be "overlaid" just like libraries
![Page 141: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/141.jpg)
Reporting
Finding, Counting, and
Extracting Tickets
![Page 142: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/142.jpg)
The RT Layer Cake
![Page 143: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/143.jpg)
Important Classes
• RT::Attachment
• RT::CustomField
• RT::Link
• RT::Queue
• RT::Ticket
• RT::Transaction
• RT::User
![Page 144: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/144.jpg)
Collection Classes
• RT::Attachments
• RT::CustomFields
• RT::Links
• RT::Queues
• RT::Tickets
• RT::Transactions
• RT::Users
![Page 145: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/145.jpg)
Finding Tickets
• Limit
• DBIx::SearchBuilder-Like
• TicketSQL
• SQL-like query language
• Direct Database Access
• Try to avoid this if you can
![Page 146: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/146.jpg)
TicketSQL
• A SQL WHERE clause style syntax for searching for
tickets
• Basic Component:
• Field + Operation + Value
• Boolean Logic and Grouping
• AND / OR / ( )
![Page 147: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/147.jpg)
TicketSQL: Search Terms
• Defined in Tickets_Overlay.pm
• Status, Queue, Type, Creator, LastUpdatedBy,
Owner, EffectiveId, id, InitialPriority, FinalPriority,
Priority, TimeLeft, TimeWorked, MemberOf,
DependsOn, RefersTo, HasMember,
DependentOn, ReferredTo, Told, Starts, Started,
Due, Resolved, LastUpdated, Created, Subject,
Type, Content, ContentType, Filename,
TransactionDate, Requestor, CC, AdminCC,
Watcher, LinkedTo, CF
![Page 148: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/148.jpg)
TicketSQL: Custom Fields
• "CF.{Field Name}"
![Page 149: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/149.jpg)
TicketSQL: Usage
my $ts = RT::Tickets->new( $CurrentUser );
$ts->FromSQL( q[Queue = "perl5"] );
![Page 150: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/150.jpg)
TicketSQL: Examples
Queue = "perl5"
AND ( "Status" = "new" OR Status = "open" )!
Queue = "parrot" AND "CF.{Priority}" = "High"
Queue = "perl5" AND Owner = "jhi"
AND Created < "2003-05-29"
![Page 151: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/151.jpg)
TicketSQL:Complex Queries
• Created last week and owned by Jesse, or created This
week and owned by Robert(Created > 'two weeks ago' AND Created < 'one week ago' AND Owner = "Jesse")
OR ( Created > 'one week ago' AND Owner = "Robert" )!
• Things in the Premium queue, or high priority things
in the support queue, or things in the support queue
more than two days old.(Queue = "support" AND Priority> 50) OR (Queue ="Premium")
OR (Queue ="support" and Created < 'two days ago')!
![Page 152: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/152.jpg)
Finding Other Things(not Tickets)!
• DBIx::SearchBuilder
• For everything
• Find all users named Robertmy $users = RT::Users($CurrentUser);
$users->Limit( FIELD => 'Name',
OPERATOR => 'LIKE', VALUE => 'Robert' );
![Page 153: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/153.jpg)
Counting Results
• $users->Count()!
![Page 154: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/154.jpg)
Sorting Results
$users->OrderBy( FIELD => "Name", ORDER => "ASC" );
• Fields:
• Defined in User.pm ($Class.pm)!
• Orders:
• ASC
• DESC
![Page 155: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/155.jpg)
Listing off Results
• Collections have an iterator
$users = new RT::Users( $CurrentUser );
$users->UnLimit();
while( my $u = $users->Next ) {
print $u->Name,"\n";
}
![Page 156: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/156.jpg)
Report Structure
• Query
• What records do I want?
• Renderer
• How do I want to output them?
![Page 157: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/157.jpg)
Writing Queries
• Finding tickets
![Page 158: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/158.jpg)
TicketSQL vs. Limit
• Concise
• Explicit
• Explicit grouping
• Easy to serialize
• If you know SQL, this
is easy
• Can be verbose
• DWIM
• Implicit grouping
• Hacky to serialize
• Designed for iterative
searches
• Requires understanding
the concept
![Page 159: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/159.jpg)
Recent Tickets: Limit
my $queue = new RT::Queue( $CurrentUser );
$queue->Load('perl5');
$recent = new RT::Tickets( $CurrentUser );
$recent->LimitQueue( VALUE => $queue, OPERATOR => '=' );
$recent->Limit( FIELD => 'Created',
OPERATOR => '>',
VALUE => 'one week ago' );
$recent->Limit( FIELD => 'Status',
OPERATOR => '=',
VALUE => 'New' );
$recent->Limit( FIELD => 'Status',
OPERATOR => '=',
VALUE => 'Open' );
![Page 160: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/160.jpg)
Recent Tickets: TicketSQL
$recent = new RT::Tickets( $CurrentUser );
$recent->FromSQL(
"(Queue = 'perl5' and Created > 'one week ago')
and (Status = 'new' or Status = 'open')"
);
![Page 161: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/161.jpg)
Current Status
my %data = ();
my $q = "perl5";
for my $status (
qw[new open stalled resolved] )
{
my $search = new RT::Tickets($User);
$search->LimitQueue( VALUE => $q );
$search->LimitStatus( VALUE => $status );
my $c = $search->Count;
$data{$status} = $c;
}
![Page 162: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/162.jpg)
Writing Renderers
Loop over all the data and print it out formatted:
<table>
<tr><th>Name</th><th>Email</th></tr>
% while( my $u = $users->Next ) {
<tr><td><% $u->Name %></td>
<td><% $u->EmailAddress %></td></tr>
%}
</table>
![Page 163: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/163.jpg)
Categorized Tickets
• Organize by Custom Field
![Page 164: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/164.jpg)
Patch Status
![Page 165: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/165.jpg)
Conference Organizing
![Page 166: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/166.jpg)
Code Snippet
<%perl>
my $cfs = RT::CustomFields->new($RT::SystemUser);
$cfs->LimitToQueue("perl5");
while (my $cf = $cfs->Next) {
my $cfn = $cf->Name();
my $cf_values = $cf->Values;
while (my $cfo = $cf_values->Next()) {
my $cfv = $cfo->Name();
my $query = qq[Queue = "perl5" AND "cf.{$cfn}" = "$cfv"
AND ( Status = "New" OR Status = "Open")];
my $z = new RT::Tickets( $CurrentUser );
$z->FromSQL( $query );
</%perl>
# ... renderer ...
% }
%}
![Page 167: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/167.jpg)
GraphingPie Chart
Imager::Graph
my @status = qw[new open stalled];
for my $status (@status) {
my $search = new RT::Tickets($User);
$search->FromSQL(q[Queue="perl5" and Status="$status"]);
push @data, $search->Count;
}
use Imager::Graph::Pie;
my $pie = Imager::Graph::Pie->new;
my $img1 = $pie->draw(data=>\@data);
$img1->write(file=>"out.png");
![Page 168: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/168.jpg)
Graphing (II)!
• Values Over Time
• RRDtool
• More…
• GD::Graph
• Gnuplot
![Page 169: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/169.jpg)
Built in Graphing Support
• From Search Results
• Pie
• Bar
![Page 170: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/170.jpg)
Custom RSS Feeds
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF ...><channel rdf:about="<%$RT::WebURL%>">
<title>Tickets</title><link><%$RT::WebURL%></link>
</channel>
% while (my $Ticket = $Tickets->Next()) {
<item rdf:about="<%$RT::WebURL%>/?q=<$Ticket->Id%>">
<title><%$Ticket->Id%>: <%$Ticket->Subject%></title>
<link><%$RT::WebURL%>/?q=<%$Ticket->Id%></link>
</item>
% }
</rdf:RDF>
% $m->abort();
<%INIT>
my $Tickets = RT::Tickets->new($session{'CurrentUser'});
$Tickets->FromSQL( 'Owner = '.$session->{'CurrentUser'}->Name . 'AND
Status = "open"' );
</%INIT>
![Page 171: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/171.jpg)
Ical Export
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
VERSION:2.0
%while (my $ticket = $tix->Next) {
% my $start = Date::ICal->new(
epoch => $ticket->DueObj->Unix);
BEGIN:VEVENT
SUMMARY:#<%$ticket->Id%>: <%$ticket->Subject%>
DTSTART;VALUE=DATE-TIME:<% $start->ical%>
DTEND;VALUE=DATE-TIME:<% $start->ical %>
END:VEVENT
% }
END:VCALENDAR
![Page 172: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/172.jpg)
Direct SQL Query
• Bending the rules
• Hard to write
• Hard to understand
• Hard to maintain
• Things to remember
• Ticket.EffectiveId
• Disabled Flags
![Page 173: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/173.jpg)
Reporting Extensions
• RT::Extension::ActivityReports
• RTx::Statistics
![Page 174: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/174.jpg)
Approvals and
Workflow
![Page 175: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/175.jpg)
Approval Basics
• Create tickets based on a template
• Dependency Chains
• Often used for "Managerial Approval"
• Workflow Modeling
• "a ticket depends on its approvals"
![Page 176: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/176.jpg)
Example Approval
• OnCreate / Create Tickets
• Template:
• ===Create-Ticket: ManagerApproval
• Subject: {$TOP->Subject} Approval
• Queue: ___Approvals
• Type: approval
• Depended-On-By: {$TOP->Id}
• Content: Please review {$TOP->OwnerObj->Name}'s
ticket number {$TOP->Id} for approval.
• ENDOFCONTENT
![Page 177: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/177.jpg)
Enforcement
• RT requires all dependencies to be resolved before
a Ticket can be resolved
![Page 178: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/178.jpg)
CreateTicket Templates
• ===Create-Ticket: title
• Fields:
• Queue, Subject, Status, Due, Starts, Started,
Resolved, Owner, Requestor, CC, AdminCC,
TimeWorked, TimeEstimated, TimeLeft,
InitialPriority, Type, DependsOn,
DependedOnBy,RefersTo, ReferredToBy,
Members, MemberOf, Content, ContentType,
CustomField-<id#>
![Page 179: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/179.jpg)
Important Fields
• Queue
• Type
• Ticket
• Approval
• Content
• ENDOFCONTENT
![Page 180: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/180.jpg)
Approval Notifications
• Approvals queue configured by default
• To edit, you need to get there manually
• $RT::WebUrl/Admin/Queues/Scrips.html?id=2
![Page 181: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/181.jpg)
Default Approval Scrips
• When creating an approval ticket: notify the
Owner and AdminCc
• User Defined / Notify Owner /
template New Pending Approval
• If an approver rejects: reject the original and
delete pending approvals
• On Status Change / User Defined /
template Approval Rejected
![Page 182: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/182.jpg)
Default Approval Scrips
• After any approver approves: add
correspondence to the original ticket
• On Resolve / User Defined /
template Approval Passed
• After all approvers approve: add correspondence
to the original ticket
• On Resolve / User Defined /
template All Approvals Passed
![Page 183: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/183.jpg)
Authentication
Tips and Tricks
![Page 184: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/184.jpg)
The RT Layer Cake
![Page 185: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/185.jpg)
Basics
• RT has a built in authentication system
• Users
• Groups
• Delegation of Rights
![Page 186: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/186.jpg)
Unified Authentication
• Simplify your life
• Centralized Administration
• Simplify your users' lives
• One username
• One password
![Page 187: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/187.jpg)
mod_auth_*
• LDAP
• Kerberos
• PAM
• NT Domain
• NDS
• Lotus Notes
• Radius
SMBTACACS+
NIS/YPSecureIDText files
SQL Database
![Page 188: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/188.jpg)
RT_SiteConfig.pm
• Trust REMOTE_USER
• Set($WebExternalAuth, 1);
• Fallback to RT database
• Set($WebFallbackToInternalAuth, 1);
• Autocreate Users
• Set($WebExternalAuto, 1);
![Page 189: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/189.jpg)
Apache Side
• Different for every module.
• Basic Format is
• <Location /rt3>
<Limit GET POST>
AuthType Basic
AuthName "MyCo RT"
AuthUserFile /etc/httpd/rt-passwd
require valid-user
</Limit>
</Location>
![Page 190: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/190.jpg)
MySQL Auth
• <Location /rt3>
• SetHandler perl-script
• PerlHandler RT::Mason
• AuthName perl.org
• AuthType Basic
• AuthMySQLHost localhost
• AuthMySQLDB userdb
• AuthMySQLUser userdbuser
• AuthMySQLPassword userdbpass
![Page 191: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/191.jpg)
RT as anAuthentication Source
• Users table
• Name
• Password (MD5)!
• Suitable for mod_auth_mysql
• Easy to use elsewhere
![Page 192: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/192.jpg)
RT Auth Ideas
• mod_auth_rt*
• Authen::RT*
• pam_rt*
• Overlay RT::User->IsPassword()!
• * denotes figment of Robert's imagination
![Page 193: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/193.jpg)
Tuning and Debugging
Places to look when things go wrong
![Page 194: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/194.jpg)
Logging (I)!
• A _lot_ of information gets logged
• RT_SiteConfig.pm:
• Set($LogToSyslog, '' );
• Set($LogToScreen, 'error' );
• Set($LogToFile, 'debug' );
• Set($LogDir, '/opt/rt3/var/log' );
• Set($LogToFileNamed, 'rt.log' );
![Page 195: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/195.jpg)
Logging (II)!
• Levels:
• debug, info, notice, warning, error, critical, alert,
emergency
• Use:
• $RT::Logger->warning("beware of dog");
![Page 196: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/196.jpg)
Apache Error Log
• Captures STDERR
• Perl Warnings/Errors
![Page 197: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/197.jpg)
Small Test Cases
• Small command line scripts are easier to debug
than the Mason UI
![Page 198: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/198.jpg)
Optimization and
Tuning
![Page 199: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/199.jpg)
Database Tuning
![Page 200: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/200.jpg)
Bang for the Buck
• RT is database-bound
• Making your database faster will make RT faster
• The Hardware Solution
• More RAM
• More RAM
• Faster and more CPUs
• Faster Disk
![Page 201: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/201.jpg)
MySQL
• my.cnf
• key_buffer=256M
• table_cache=256
• sort_buffer=2M
• record_buffer=2M
• thread_cache=8
• thread_concurrency=4
• Higher is better… to a point
• MySQL 5.1 isn’t ready
![Page 202: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/202.jpg)
MySQL Query Cache
• Cache results at the database level
• query_cache_size=32M
• query_cache_type=1
![Page 203: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/203.jpg)
Postgres
• Tell it to use more RAM
• VACUUM ANALYZE
• Improves query analyzer
• Query Analyzer highly configurable
• Newer versions are better
• Use 8.1.3 or newer
![Page 204: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/204.jpg)
Query Tuning
• Postgres and MySQL have very different query
optimizers
• One sub-optimal query can take a disproportionate
amount of time
• Use query logging to identify bottlenecks
![Page 205: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/205.jpg)
MySQL: Logging
• to enable Query Logging…
• my.cnf: log
• safe_mysqld: --log
• output: `hostname`.log
• to enable Slow Query Log…
• my.cnf: log-slow-queries
• my.cnf: long_query_time seconds (default: 10)!
• safe_mysqld: --log-slow-queries
• output: `hostname`-slow.log
![Page 206: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/206.jpg)
MySQL: Explain
How a SELECT is processed
mysql> explain SELECT * FROM Scrips WHERE id = '13';
+--------+-------+---------------+---------+---------+-------+------+-------+
| table | type | possible_keys | key | key_len | ref | rows | Extra |
+--------+-------+---------------+---------+---------+-------+------+-------+
| Scrips | const | PRIMARY | PRIMARY | 4 | const | 1 | |
+--------+-------+---------------+---------+---------+-------+------+-------+
1 row in set (0.09 sec) !
Good: where, index
Bad: temporary, filesort
MySQL Documentation, Chapter 5
![Page 207: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/207.jpg)
Postgres: Logging
• Postgresql.conf
• log_statement = true
• log_duration = true
• log_timestamp = true
![Page 208: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/208.jpg)
Postgres: Explain
• Postgres' explain works like MySQL's.
• Different results
![Page 209: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/209.jpg)
Oracle
• Take your DBA out to lunch
• ..often
![Page 210: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/210.jpg)
Adding New Indexes
• If filesort, temporary, or table scan…
• An index might help
• Single Column Index
• Multiple Column Index
• Different Databases
• Per-site differences
• The wrong indexes can hurt
![Page 211: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/211.jpg)
Perl DBI Logging
• DBI_TRACE environment variable
• Before starting apache,
• export DBI_TRACE=1=file.log
• Values
• 0 - Trace disabled.
• 1 - Trace DBI method calls returning with results or
errors.
• 2 - Trace method entry with parameters and returning
with results.
• 3+ - Even more details
• perldoc DBI
![Page 212: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/212.jpg)
Thanks!
![Page 213: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/213.jpg)
Contributing
• If you find bugs, everyone wins if you report
them
• Lots of other folks use and hack on RT. Join the
mailing list to share tips and tricks.
![Page 214: All About RT - assets.en.oreilly.comassets.en.oreilly.com/1/event/27/Request Tracker Boot Camp Present… · 9 RT 1.0 (1999)! • Same as RT 0.9 • (+ a bit more courage)! • Used](https://reader036.vdocuments.us/reader036/viewer/2022081613/5fba9b3aaf3373281c77ee05/html5/thumbnails/214.jpg)
Recommended Reading
• RT Essentials
• Embedding Perl in HTML with Mason
• perldoc RT::StyleGuide
• perldoc RT::Ticket
• perldoc RT::Ticket_Overlay