[rt-users] emailing Ticket comments to AdminCc

Aaron Turner aturner at netscreen.com
Mon Jul 21 20:10:57 EDT 2003


I'm running 3.0.4 w/ MySQL and I'm trying to get the
OnComment:Notify AdminCc:Admin Comment Scrip to work.

Basically, I'm using a custom perl script running out of cron to
not only increase the priority over time, but also to add AdminCc's and
comments to the ticket.  (Yes, this is based on Travis Campbell's work.)

Anyways, I'm having a problem where when I add the comment to the
ticket, I'm getting an error written to STDOUT:

Recipient names must be specified

I then see in my mail log, an email being sent with no recipients
(sendmail saying: nrcpts=0) and no email is ever recieved.

The odd thing is that I do get emails sent when a ticket is created and
that queue has an AdminCc watcher. (I've got another Scrip for On
Create:Notify AdminCc:Transaction, but that of course is running
internal to RT, not my perl script via cron.)

Anyways, I've verified that the comment and AdminCc's are properly being
added to the ticket, it's just the OnComment:Notify AdminCc Scrip not
working.

Basically the comment code looks like this:

my $QUEUE = 'testing';
use RT::Interface::CLI  qw(CleanEnv GetCurrentUser GetMessageContent loc);
CleanEnv();
use RT;
RT::LoadConfig();
RT::Init();
use RT::Tickets;

my $tickets = new RT::Tickets($RT::SystemUser);
$tickets->LimitQueue(VALUE => $QUEUE);
$tickets->LimitStatus(VALUE => 'open');
$tickets->LimitStatus(VALUE => 'new');

while (my $ticket = $tickets->Next) {
  $ticket->AddWatcher(Type => 'AdminCc',
                      Email => 'aturner at netscreen.com',
                      Silent => 1);
  TicketComment($ticket);
}

sub TicketComment {
  my $self = shift;
  my $priority = shift;

  require MIME::Entity;

  my $comment = 'this is a comment';
  $self->Comment(Content => $comment);
}

Thanks.

-- 
Aaron Turner  <aturner at netscreen.com>    work: 408-543-4025
Sr. Security Engineer                    fax:  408-543-4078
NetScreen Technologies, Inc
All emails by me are PGP signed; a bad signature indicates a forgery.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 244 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20030721/7ebf4fe3/attachment.sig>


More information about the rt-users mailing list