Custom action - http://wiki.bestpractical.com/view/AutoCcOwner

Hi,

Should this work on 3.8.3?

I’m trying it with this in the Custom Action:

$RT::Logger->info(“AutoCcOwnerScrip”);
my $last_id = $self->TransactionObj->NewValue;
my $temp_user = RT::User->new();
$temp_user->Load($last_id);
my $last_email = $temp_user->EmailAddress();
$RT::Logger->info("$last_email");
$self->TicketObj->AddWatcher( Type => “Cc”,
Email => $last_email);

return 1;

and return 1; in cleanup.

I can’t see my $RT::Logger stuff at all in rt.log

Thanks.

  1. may be you forgot to set action to “user defined”
  2. RT::User->new(); should be called with current user: RT::User->new(
    $self->TicketObj->CurrentUser );
  3. you don’t check any errorsOn Sat, May 30, 2009 at 1:59 AM, Gavin Henry gavin.henry@gmail.com wrote:

Hi,

Should this work on 3.8.3?

I’m trying it with this in the Custom Action:

$RT::Logger->info(“AutoCcOwnerScrip”);
my $last_id = $self->TransactionObj->NewValue;
my $temp_user = RT::User->new();
$temp_user->Load($last_id);
my $last_email = $temp_user->EmailAddress();
$RT::Logger->info("$last_email");
$self->TicketObj->AddWatcher( Type => “Cc”,
Email => $last_email);

return 1;

and return 1; in cleanup.

I can’t see my $RT::Logger stuff at all in rt.log

Thanks.


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Best regards, Ruslan.

  1. may be you forgot to set action to “user defined”

Nope, checked that.

  1. RT::User->new(); should be called with current user: RT::User->new(
    $self->TicketObj->CurrentUser );

OK, changed.

  1. you don’t check any errors

For example? Should they be more wrapped like:

http://wiki.bestpractical.com/view/OnCreateSetDeptHeadCc> On Sat, May 30, 2009 at 1:59 AM, Gavin Henry gavin.henry@gmail.com wrote:

Hi,

Should this work on 3.8.3?

I’m trying it with this in the Custom Action:

$RT::Logger->info(“AutoCcOwnerScrip”);
my $last_id = $self->TransactionObj->NewValue;
my $temp_user = RT::User->new();
$temp_user->Load($last_id);
my $last_email = $temp_user->EmailAddress();
$RT::Logger->info("$last_email");
$self->TicketObj->AddWatcher( Type => “Cc”,
Email => $last_email);

return 1;

and return 1; in cleanup.

I can’t see my $RT::Logger stuff at all in rt.log

Thanks.


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


Best regards, Ruslan.

http://www.suretecsystems.com/services/openldap/