On Sep 19, 2016, at 12:38 PM, Jim Brandt 
<jbra...@bestpractical.com<mailto:jbra...@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:

https://github.com/bestpractical/rtir/blob/4.0-trunk/html/Callbacks/RTIR/Elements/ShowHistoryPage/SkipTransaction

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
INTERNAP ®
📧 lstew...@internap.com<mailto:lstew...@internap.com>
🌍 www.internap.com<http://www.internap.com>

---------
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017

Reply via email to