<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt">Dear Christian<br><br>Thank you I applied some changes and I get still an error:<br><br>Oct 26 13:56:15 rt RT: Scrip Prepare 14 died. - Can't locate object method "new" via package "RT::Action::OpenSystemCustomFields" at /usr/share/request-tracker4/lib/RT/ScripAction.pm line 175.#012#012Stack:#012 [/usr/share/request-tracker4/lib/RT/ScripAction.pm:175]#012 [/usr/share/request-tracker4/lib/RT/Scrip.pm:443]#012 [/usr/share/request-tracker4/lib/RT/Scrips.pm:252]#012 [/usr/share/request-tracker4/lib/RT/Transaction.pm:179]#012 [/usr/share/request-tracker4/lib/RT/Record.pm:1459]#012 [/usr/share/request-tracker4/lib/RT/Ticket.pm:676]#012 [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:1711]#012 [/usr/share/request-tracker4/html/Ticket/Display.html:128]#012
[/usr/share/request-tracker4/html/Ticket/Create.html:444]#012 [/usr/share/request-tracker4/html/Ticket/autohandler:19]#012 [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:568]#012 [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:318]#012 [/usr/share/request-tracker4/html/autohandler:53] (/usr/share/request-tracker4/lib/RT/Scrip.pm:451)<br><br>What am I doing wrong ? <br><br>Do I really need a sub new() ???<br><br>Thanks sincerely,<br><br>Denis<br><br><br>#-----------------------------OpenSystemCustomFields---------------------#<br><br>package RT::Action::OpenSystemCustomFields;<br><br>use strict;<br>use warnings;<br>use base qw(RT::Action);<br>our $VERSION = '0.01';<br><br>sub Describe {<br> my $self = shift;<br> my $class = ref($self) || $self;<br> return "$class will retrive values from the OS database and create dynamic CustomFields.";<br>}<br><br>sub Prepare
{<br> my $self = shift;<br> my $class = ref($self) || $self;<br> return 1;<br>}<br><br>sub Commit {<br> my $self = shift;<br> my $class = ref($self) || $self;<br> return 1;<br>}<br><br>RT::Base->_ImportOverlays();<br><br># ;)<br>1;<br><br><br><br> <div><br><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Christian Loos <cloos@netcologne.de><br> <b><span style="font-weight: bold;">To:</span></b> Red Pantyhose <redpantyhose@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "rt-users@lists.bestpractical.com" <rt-users@lists.bestpractical.com> <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, October 26, 2012 3:17 PM<br> <b><span style="font-weight:
bold;">Subject:</span></b> Re: Write a Custom Action in rt4 as a Module/package ERROR<br> </font> </div> <br>
uncomment this line:<br>#use base qw(RT::Action);<br><br>Chris<br><br>Am 26.10.2012 15:02, schrieb Red Pantyhose:<br>> Dear rt-users<br>> <br>> I created the following ActionScrip Module below - the Module is<br>> registered.<br>> <br>> But i get the following Error:<br>> <br>> Oct 26 14:42:49 rt RT: Scrip Prepare 14 died. - Can't locate object<br>> method "new" via package "RT::Action::OpenSystemCustomFields" at<br>> /usr/share/request-tracker4/lib/RT/ScripAction.pm line<br>> 175.#012#012Stack:#012 <br>> [/usr/share/request-tracker4/lib/RT/ScripAction.pm:175]#012 <br>> [/usr/share/request-tracker4/lib/RT/Scrip.pm:443]#012 <br>> [/usr/share/request-tracker4/lib/RT/Scrips.pm:252]#012 <br>> [/usr/share/request-tracker4/lib/RT/Transaction.pm:179]#012 <br>> [/usr/share/request-tracker4/lib/RT/Record.pm:1459]#012 <br>> [/usr/share/request-tracker4/lib/RT/Ticket.pm:676]#012 <br>>
[/usr/share/request-tracker4/lib/RT/Interface/Web.pm:1711]#012 <br>> [/usr/share/request-tracker4/html/Ticket/Display.html:128]#012 <br>> [/usr/share/request-tracker4/html/Ticket/Create.html:444]#012 <br>> [/usr/share/request-tracker4/html/Ticket/autohandler:19]#012 <br>> [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:568]#012 <br>> [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:318]#012 <br>> [/usr/share/request-tracker4/html/autohandler:53]<br>> (/usr/share/request-tracker4/lib/RT/Scrip.pm:451)<br>> <br>> I'm using rt-4.0.5.<br>> <br>> What am I doing wrong ?<br>> <br>> Thanks Sincerely<br>> <br>> Denis<br>> <br>> <br>> #-------------------------------------OpenSystemCustomFields.init-------------------------------------------#<br>> <br>> # To initialize the OpenSystemCustomFields ActionScrip:<br>> # rt-setup-database-4 --action insert --datafile
OpenSystemCustomFields.init<br>> <br>> @ScripActions = (<br>> {<br>> Name => 'OpenSystemCustomFields',<br>> Description => 'Create CustomFields from data retrieved out of the<br>> OpenSystem DB',<br>> ExecModule => 'OpenSystemCustomFields',<br>> Argument => ''<br>> },<br>> );<br>> <br>> <br>> <br>> <br>> #-------------------------------------OpenSystemCustomFields.pm-------------------------------------------#<br>> use strict;<br>> use warnings;<br>> <br>> package RT::Action::OpenSystemCustomFields;<br>> <br>> #use base qw(RT::Action);<br>> <br>> #use base qw(RT::Action::Generic);<br>> <br>> sub Prepare {<br>> my $self = shift;<br>> return 1;<br>> }<br>> <br>> sub Commit {<br>> my $self = shift;<br>> return 1;<br>>
}<br>> <br>> # ;)<br>> 1;<br>> <br>> <br>> <br>> <br>> <br>> <br>> <br>> --------<br>> We're hiring! http://bestpractical.com/jobs<br>> <br><br><br><br> </div> </div> </div></div></body></html>