[rt-users] Filter ticket text for display?
Kevin Falcone
falcone at bestpractical.com
Mon Jul 9 11:58:55 EDT 2007
On Jul 9, 2007, at 10:56 AM, Gary Oberbrunner wrote:
> Kevin Falcone wrote:
>>
>> On Jul 9, 2007, at 10:06 AM, Gary Oberbrunner wrote:
>>
>>> Hi folks -- is there a hook to filter or process the ticket
>>> history texts
>>> (email bodies) when they're displayed? We'd like to turn certain
>>> pieces of
>>> text (identified by regex) into html links.
>>
>> You should be able to use the ModifyDisplay callback in
>> Tickets/Elements/ShowTransaction to do this.
>
> Thanks, Kevin -- that looks like exactly what I need. I'll try
> it. Does
> anyone have a sample Callbacks/*/Elements/Ticket/ShowTransaction/
> ModifyDisplay
> callback? I don't really understand the calling convention, i.e.
> what are the
> args and what I'm supposed to return. Should I write a function,
> or is it
> just bare Mason/perl code? What are %INIT% and %ARGS% (I see those
> in some
> other callbacks)? Where do I get the actual ticket text (message
> body)?
>
> (I looked at the rt wiki page "CustomizingWithCallbacks" and it
> explains the
> proper file/dir to put the callback in, but doesn't say what it
> should look like.)
The RTFM and RTIR packages on http://download.bestpractical.com/pub/
rt/devel/ make
extensive use of callbacks. I'm not sure if they use that specific
callback, but
you should be able to understand the technique from them.
-kevin
More information about the rt-users
mailing list