[rt-devel] help needed creating tickets via script.(not scrip)

Matthew Watson mwatson at office.netspace.net.au
Wed Apr 10 00:37:55 EDT 2002


 I'm trying to create a ticket from a perl script. everything is fine,
except I get the message

"RT::Action::Autoreply=HASH(0x87565c8): Could not send mail for

However... the requestor is sent an email.. this error message does not
happen when a ticket in created via the web interface or email...

the code I have is as follows ..

There is only ever 1 requestor, and i've confirmed that the requestors array
doesn't have any weird stuff in it.. any ideas??


my $MIMEObj = MIME::Entity->build(Data => \@message);

    #Load the user
    my $CurrentUser = new RT::CurrentUser();
    unless ($CurrentUser->id){
      print "Error:Could not load user\r\n";

#    print Dumper($CurrentUser);
    #make sure the queue is valid
    my $QueueObj = new RT::Queue($RT::SystemUser);
      print "Error:Invalid Queue\r\n";
    my @requestors = ($CurrentUser->id);
    print Dumper(\@requestors);
    my $Ticket = new RT::Ticket($CurrentUser);
    my ($ticket,$trans,$msg) = $Ticket->Create(Queue => $QueueObj,
                                               Status => 'new',
                                              Subject => $info->{'Subject'},
                                              Requestor => \@requestors,
                                              MIMEObj => $MIMEObj);

    if ($ticket == 0 ) {
        print "Error: $msg\r\n";
    } else {
        print "TicketID: $ticket\r\n";

Matthew Watson
Development, Netspace Online Systems
mwatson at netspace.net.au

More information about the Rt-devel mailing list