Write a Custom Action in rt4 as a Module/package ERROR

Dear rt-users

I created the following ActionScrip Module below - the Module is registered.

But i get the following Error:

Oct 26 14:42:49 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)

I’m using rt-4.0.5.

What am I doing wrong ?

Thanks Sincerely

Denis

#-------------------------------------OpenSystemCustomFields.init-------------------------------------------#

To initialize the OpenSystemCustomFields ActionScrip:

rt-setup-database-4 --action insert --datafile OpenSystemCustomFields.init

@ScripActions = (
{
Name => ‘OpenSystemCustomFields’,
Description => ‘Create CustomFields from data retrieved out of the OpenSystem DB’,
ExecModule => ‘OpenSystemCustomFields’,
Argument => ‘’
},
);

#-------------------------------------OpenSystemCustomFields.pm-------------------------------------------#
use strict;
use warnings;

package RT::Action::OpenSystemCustomFields;

#use base qw(RT::Action);

#use base qw(RT::Action::Generic);

sub Prepare {
my $self = shift;
return 1;
}

sub Commit {
my $self = shift;
return 1;
}

:wink:

1;

uncomment this line:
#use base qw(RT::Action);

ChrisAm 26.10.2012 15:02, schrieb Red Pantyhose:

Dear rt-users

I created the following ActionScrip Module below - the Module is
registered.

But i get the following Error:

Oct 26 14:42:49 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)

I’m using rt-4.0.5.

What am I doing wrong ?

Thanks Sincerely

Denis

#-------------------------------------OpenSystemCustomFields.init-------------------------------------------#

To initialize the OpenSystemCustomFields ActionScrip:

rt-setup-database-4 --action insert --datafile OpenSystemCustomFields.init

@ScripActions = (
{
Name => ‘OpenSystemCustomFields’,
Description => ‘Create CustomFields from data retrieved out of the
OpenSystem DB’,
ExecModule => ‘OpenSystemCustomFields’,
Argument => ‘’
},
);

#-------------------------------------OpenSystemCustomFields.pm-------------------------------------------#
use strict;
use warnings;

package RT::Action::OpenSystemCustomFields;

#use base qw(RT::Action);

#use base qw(RT::Action::Generic);

sub Prepare {
my $self = shift;
return 1;
}

sub Commit {
my $self = shift;
return 1;
}

:wink:

1;


We’re hiring! http://bestpractical.com/jobs

Dear Christian

Thank you I applied some changes and I get still an error:

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)

What am I doing wrong ?

Do I really need a sub new() ???

Thanks sincerely,

Denis

#-----------------------------OpenSystemCustomFields---------------------#

package RT::Action::OpenSystemCustomFields;

use strict;
use warnings;
use base qw(RT::Action);
our $VERSION = ‘0.01’;

sub Describe {
my $self = shift;
my $class = ref($self) || $self;
return “$class will retrive values from the OS database and create dynamic CustomFields.”;
}

sub Prepare {
my $self = shift;
my $class = ref($self) || $self;
return 1;
}

sub Commit {
my $self = shift;
my $class = ref($self) || $self;
return 1;
}

RT::Base->_ImportOverlays();

:wink:

1;From: Christian Loos cloos@netcologne.de
To: Red Pantyhose redpantyhose@yahoo.com
Cc: “rt-users@lists.bestpractical.comrt-users@lists.bestpractical.com
Sent: Friday, October 26, 2012 3:17 PM
Subject: Re: Write a Custom Action in rt4 as a Module/package ERROR

uncomment this line:
#use base qw(RT::Action);

Chris

Did you restart RT after making the change? Unless you’re in development
mode, it won’t pick up the changes. You probably need to flush your mason
cache as well, just to be safe.On Fri, Oct 26, 2012 at 9:40 AM, Red Pantyhose redpantyhose@yahoo.comwrote:

Dear Christian

Thank you I applied some changes and I get still an error:

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)

What am I doing wrong ?

Do I really need a sub new() ???

Thanks sincerely,

Denis

#-----------------------------OpenSystemCustomFields---------------------#

package RT::Action::OpenSystemCustomFields;

use strict;
use warnings;
use base qw(RT::Action);
our $VERSION = ‘0.01’;

sub Describe {
my $self = shift;
my $class = ref($self) || $self;
return “$class will retrive values from the OS database and create
dynamic CustomFields.”;

}

sub Prepare {
my $self = shift;
my $class = ref($self) || $self;

return 1;
}

sub Commit {
my $self = shift;
my $class = ref($self) || $self;
return 1;
}

RT::Base->_ImportOverlays();

:wink:

1;


From: Christian Loos cloos@netcologne.de
To: Red Pantyhose redpantyhose@yahoo.com
Cc:rt-users@lists.bestpractical.comrt-users@lists.bestpractical.com

Sent: Friday, October 26, 2012 3:17 PM
Subject: Re: Write a Custom Action in rt4 as a Module/package ERROR

uncomment this line:
#use base qw(RT::Action);

Chris

Am 26.10.2012 15:02, schrieb Red Pantyhose:

Dear rt-users

I created the following ActionScrip Module below - the Module is
registered.

But i get the following Error:

Oct 26 14:42:49 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)

I’m using rt-4.0.5.

What am I doing wrong ?

Thanks Sincerely

Denis

#-------------------------------------OpenSystemCustomFields.init-------------------------------------------#

To initialize the OpenSystemCustomFields ActionScrip:

rt-setup-database-4 --action insert --datafile

OpenSystemCustomFields.init

@ScripActions = (
{
Name => ‘OpenSystemCustomFields’,
Description => ‘Create CustomFields from data retrieved out of the
OpenSystem DB’,
ExecModule => ‘OpenSystemCustomFields’,
Argument => ‘’
},
);

#-------------------------------------OpenSystemCustomFields.pm-------------------------------------------#

use strict;
use warnings;

package RT::Action::OpenSystemCustomFields;

#use base qw(RT::Action);

#use base qw(RT::Action::Generic);

sub Prepare {
my $self = shift;
return 1;
}

sub Commit {
my $self = shift;
return 1;
}

:wink:

1;


We’re hiring! http://bestpractical.com/jobs


We’re hiring! http://bestpractical.com/jobs

http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin