[rt-users] Unable to use NotifyGroup with rt-crontool

Shrivallabh Deshmukh shrivallabh.deshmukh at sungard.com
Fri Aug 3 05:23:35 EDT 2012


Folks,

I am unable to use the rt-crontool with NotifyGroup action

This is what I am running

/opt/rt4/bin/rt-crontool --search RT::Search::ActiveTicketsInQueue
 --search-arg QueueName --condition RT::Condition::Overdue --action
RT::Action::NotifyGroup --action-arg GroupName


And this is the error I get

[Fri Aug  3 09:03:43 2012] [critical]: Can't call method "CreatorObj" on an
undefined value at /opt/rt4/bin/../lib/RT/Action/NotifyGroup.pm line 87.
(/opt/rt4/bin/../lib/RT.pm:341)

This is the function that is failing

sub SetRecipients {
    my $self = shift;

    my $arg = $self->Argument;
    foreach( $self->__SplitArg( $arg ) ) {
        $self->_HandleArgument( $_ );
    }

    my $creatorObj = $self->TransactionObj->CreatorObj;
    my $creator = $creatorObj->EmailAddress();

    my $TransactionCurrentUser = RT::CurrentUser->new;
    $TransactionCurrentUser->LoadByName($creatorObj->Name);

    unless (RT->Config->Get('NotifyActor',$TransactionCurrentUser)) {
        @{ $self->{'To'} } = grep ( !/^\Q$creator\E$/, @{ $self->{'To'} } );
    }

    $self->{'seen_ueas'} = {};

    return 1;
}

And the line that is failing is  my $creatorObj =
$self->TransactionObj->CreatorObj;


I checked to see that the group is getting loaded correctly. But it is not
able to get hold of a transactionObk it seems like.

That makes sense since there is no transaction that has occured. Rather
this is a cronjob which is triggering the action.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120803/39bb96d8/attachment.htm>


More information about the rt-users mailing list