I create a simple script using Articlecreate API ( use Kernel::System::Ticket::Article;).
First of all i try to add article using existing ticket. But i got msg error below :
Global symbol "$TicketObject" requires explicit package name at otrs1.pl line 18.
Global symbol "$ArticleID" requires explicit package name at otrs1.pl line 33.
syntax error at otrs1.pl line 35, near ");"
Execution of otrs1.pl aborted due to compilation errors.
Any tough ?
J-F
Code: Select all
***otrs.pl***
use strict;
use warnings;
use utf8;
use vars (qw($Self));
use lib "/opt/otrs/";
use lib "/opt/otrs/Kernel/cpan-lib";
use lib "/opt/otrs/Custom";
use Time::HiRes qw( usleep );
use Kernel::Config;
use Kernel::System::Ticket;
use Kernel::System::Ticket::Article;
my $ArticleID = $TicketObject->ArticleCreate(
TicketID => 12859,
ArticleType => 'note-internal',
SenderType => 'agent',
From => 'Completed <no@reply.com>',
To => 'Some Customer A <customer-a@example.com>',
Subject => 'IP Adress ',
Body => 'IP adress ready',
ContentType => 'text/plain',
HistoryType => 'AddNote',
HistoryComment => 'IP adress added',
UserID => 123,
NoAgentNotify => 0,
$Self->True(
$ArticleID,
'ArticleCreate()',
);
***otrs.pl***