Nur der Artikel erscheint nicht. Hat einer nen Tipp?
Hier mein Script:
Code: Select all
#!/usr/bin/perl -w
# --
# scripts/rpc-example.pl - soap example client
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: rpc-example.pl,v 1.6 2009/03/27 17:36:33 mh Exp $
# --
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU AFFERO General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# or see http://www.gnu.org/licenses/agpl.txt.
# --
# config
use SOAP::Lite( 'autodispatch', proxy => 'http://localhost/otrs/rpc.pl' );
my $User = 'user';
my $Pw = 'pass';
my $RPC = Core->new();
# create a new ticket number
print "NOTICE: TicketObject->TicketCreateNumber()\n";
my $TicketNumber = $RPC->Dispatch( $User, $Pw, 'TicketObject', 'TicketCreateNumber' );
print "NOTICE: New Ticket Number is: $TicketNumber\n";
# create a new ticket
my %TicketData = (
TN => $TicketNumber,
Title => 'Magix Support',
Queue => 'Support',
Lock => 'unlock',
Priority => '3 normal',
State => 'new',
CustomerID => 'monotek@gmx.net',
CustomerUser => 'monotek@gmx.net',
OwnerID => 1,
UserID => 1,
);
print "NOTICE: TicketObject->TicketCreate(%TicketData)\n";
my $TicketID = $RPC->Dispatch( $User, $Pw, 'TicketObject', 'TicketCreate', %TicketData => 1 );
print "NOTICE: TicketID is $TicketID\n";
# create new article
my $ArticleID = $RPC->Dispatch($User, $Pw, 'TicketObject', 'ArticleSend',
TicketID => $TicketID,
ArticleType => 'phone', # email-external|email-internal|phone|fax|...
SenderType => 'customer', # agent|system|customer
From => 'monotek@gmx.net', # not required but useful
To => 'Support', # not required but useful
Cc => '', # not required but useful
ReplyTo => '', # not required
Subject => 'Magix Support', # required
Body => 'New Phone Ticket', # required
MessageID => '', # not required but useful
Charset => 'utf-8',
HistoryType => 'EmailCustomer', # EmailCustomer|Move|AddNote|PriorityUpdate|WebRequestCustomer|...
HistoryComment => 'Some free text!',
UserID => 1,
NoAgentNotify => 0, # if you don't want to send agent notifications
Type => 'text/plain',
Loop => 0, # auto reject|auto follow up|auto follow up|auto remove
);
exit 0;