[rt-users] Custom fields and Callbacks

Ravi Narayan Sarma ravisarma at bell-labs.com
Thu Oct 16 18:29:40 EDT 2008


Hello all,

I have a question that I hope someone will be kind enough to answer: I  
am trying to use Callbacks to modify a CustomField.

The details: I have a custom field called "Bugs", in which Bugzilla  
bugs related to an RT ticket can be entered. Using RT's  
straightforward configuration settings, I have set up the custom field  
display to link to the Bugzilla web page for the bug. Now I want to  
try something more ambitious. I want to reflect the status of the bug  
in the displayed custom field text, by striking out the bug number(s)  
if it/they are in Bugzilla state RESOLVED, VERIFIED or CLOSED.

I can do the Perl part to get the status from Bugzilla. What I am  
flummoxed by is how to use Callbacks (or something else, if you so  
suggest) to modify the text displayed.

I peeked into Ticket/Elements/ShowCustomFields and noticed that it  
just seems to load Elements/ShowCustomFields. As far as I can tell,  
that latter file has two Callbacks, neither of which is a default  
callback. The two callbacks are:

ShowComponentName
MassageCustomFields

Somehow, I feel neither of these will do the trick for me, but even  
before I face that, I find that I am unable to even get these  
callbacks to be invoked. I created files at:

RTroot/Callbacks/Yangtze/Ticket/Elements/ShowCustomFields

with the above names, and wrote some simple code to display something  
different. I restarted the web server and reloaded a ticket page  
(shift-reload to defeat browser side cache), but it did not display my  
changes. I am following the same procedure I used to create a callback  
for ShowMessageStanza which link'ifies mentions of other tickets,  
which does work. Creating a Default callback for ShowCustomFields  
doesn't work either. I tried using Data::Dumper to dump the arguments  
to the callback into a temporary file but that didn't work either.

What am I doing wrong? And is using Callbacks even the right approach?

Thank you,

	--ravi





More information about the rt-users mailing list