[rtir] Using callbacks to modify how the correspondence transactions are displayed while viewing a ticket

Landon Stewart lstewart at internap.com
Tue Sep 20 13:59:31 EDT 2016

On Sep 19, 2016, at 12:38 PM, Jim Brandt <jbrandt at bestpractical.com<mailto:jbrandt at bestpractical.com>> wrote:

You'll find the RTIR code installed in local/plugins/RT-IR.

For what you're trying to do, you'll probably end up evaluating each transaction in the history. You might be able to start by looking at this existing callback:


Since there is an existing callback, you would need copy and modify or add a callback to the callback to add your code. The advantage of that approach is that your local change to the official RTIR file is only the single callback line, which is easier to port forward when you upgrade.

Thanks Jim.

I'm having a little difficulty understanding this part "you would need copy and modify or add a callback to the callback to add your code".  Do you mean that I should copy a file to a new file and put my code in there?  Also I tried modifying the original file (I'm using RT 4.2 w/ RTIR 3.2) at /opt/rt4/local/plugins/RT-IR/html/Callbacks/RTIR/Elements/ShowHistory/SkipTransaction with the following and it didn't change the output of a ticket at all.  (After making the change I did restart the web server and cleared the mason cache).

return unless $Transaction-Type eq 'Correspond'
    && $Transaction->Creator == RT->SystemUser->id;

I think I don't understand how $$skip gets set to one when I want to skip something if nothing else stops the call back with a return (I believe).  I see it is set to 1 at the bottom of the callback and it seems like it is allowed to do this if nothing else stops it from finishing the script like a 'return unless ...' but the logic seems backwards to me.  Basically I want to not show a Correspond transaction if it was created by the System User.  I actually want to collapse it into an expandable button but that's a whole different beast at this point, first things first.

Landon Stewart
Lead Analyst - Abuse and Security Management
📧 lstewart at internap.com<mailto:lstewart at internap.com>
🌍 www.internap.com<http://www.internap.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rtir/attachments/20160920/6392e4ea/attachment.html>

More information about the rtir mailing list