SOAP - Neuen Artikel erstellen?

Hilfe zu Znuny Problemen aller Art
Locked
Andre Bauer
Znuny guru
Posts: 2189
Joined: 08 Dec 2005, 17:01
Znuny Version: 5.0.x
Real Name: André Bauer
Company: Magix Software GmbH
Location: Dresden
Contact:

SOAP - Neuen Artikel erstellen?

Post by Andre Bauer »

Ich versuche gerade per SOAP ein neues Ticket samt Artikel zu erstellen. Das leere Ticket wird auch problemlos erstellt.

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;
Prod: Ubuntu Server 16.04 / Zammad 1.2

DO NOT PM ME WITH OTRS RELATED QUESTIONS! ASK IN THE FORUMS!

OtterHub.org
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

SOAP - Neuen Artikel erstellen?

Post by jojo »

gibts ne Fehlermeldung im Apache Error Log?
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Andre Bauer
Znuny guru
Posts: 2189
Joined: 08 Dec 2005, 17:01
Znuny Version: 5.0.x
Real Name: André Bauer
Company: Magix Software GmbH
Location: Dresden
Contact:

SOAP - Neuen Artikel erstellen?

Post by Andre Bauer »

Danke für den Tipp.

Type hättet MimeType sein müssen...

Jetzt kommt nur noch:
Message: Can't use from 'bla@gmx.net': 5505.7.0 Sender address does not belong to logged in user {mp003}
! Enable Net::SMTP debug for more info!

Traceback (24135):
Module: Kernel::System::Email::SMTP::Send (v1.25) Line: 116
Module: Kernel::System::Email::Send (v1.64) Line: 683
Module: Kernel::System::Ticket::Article::ArticleSend (v1.230) Line: 2012
Module: Core::Dispatch (unknown version) Line: 120
Module: (eval) (unknown version) Line: 2569
Module: (eval) (unknown version) Line: 2557
Module: SOAP::Server::handle (unknown version) Line: 2526
Module: SOAP::Transport::HTTP::Server::handle (unknown version) Line: 327
Module: SOAP::Transport::HTTP::CGI::handle (unknown version) Line: 423
Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_rpc_2epl::handler (unknown version) Line: 50
Module: (eval) (v1.14) Line: 204
Module: ModPerl::RegistryCooker::run (v1.14) Line: 204
Das Ticket samt Artikel wird aber trotzdem erstellt.

Kann ich die Meldung noch irgendwie verhindern?
Prod: Ubuntu Server 16.04 / Zammad 1.2

DO NOT PM ME WITH OTRS RELATED QUESTIONS! ASK IN THE FORUMS!

OtterHub.org
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

SOAP - Neuen Artikel erstellen?

Post by jojo »

die Meldung kommt ggf. wg. einer versendeten Benachrichtigung...
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Andre Bauer
Znuny guru
Posts: 2189
Joined: 08 Dec 2005, 17:01
Znuny Version: 5.0.x
Real Name: André Bauer
Company: Magix Software GmbH
Location: Dresden
Contact:

SOAP - Neuen Artikel erstellen?

Post by Andre Bauer »

Hab ich auch hinbekommen.

Statt ArticleSend einfach ArticleCreate verwenden.

Nun kommt nur noch:
[Wed Sep 9 17:33:46 2009] -e: Odd number of elements in hash assignment at /opt/otrs/bin/cgi-bin/rpc.pl line 64.
Die eine Zeile is mir aber wurscht *g*
Prod: Ubuntu Server 16.04 / Zammad 1.2

DO NOT PM ME WITH OTRS RELATED QUESTIONS! ASK IN THE FORUMS!

OtterHub.org
Andre Bauer
Znuny guru
Posts: 2189
Joined: 08 Dec 2005, 17:01
Znuny Version: 5.0.x
Real Name: André Bauer
Company: Magix Software GmbH
Location: Dresden
Contact:

SOAP - Neuen Artikel erstellen?

Post by Andre Bauer »

Wie bekomme ich eigentlich den Autoresponder zum laufen, wenn ich mit SOAP ne Nachricht einstelle?
Prod: Ubuntu Server 16.04 / Zammad 1.2

DO NOT PM ME WITH OTRS RELATED QUESTIONS! ASK IN THE FORUMS!

OtterHub.org
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

SOAP - Neuen Artikel erstellen?

Post by jojo »

das sollte anhand des Artikel Typs passieren (und ist natürlich abhängig von den Queue Settings)
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Andre Bauer
Znuny guru
Posts: 2189
Joined: 08 Dec 2005, 17:01
Znuny Version: 5.0.x
Real Name: André Bauer
Company: Magix Software GmbH
Location: Dresden
Contact:

SOAP - Neuen Artikel erstellen?

Post by Andre Bauer »

Ich nutze als ArticleTyp "phone".

Wenn ich manuell eine Telefonticket erstelle, wird die Autoantwort auch gesendet.

Bugreport?

Edit:

Es fehlte noch:

Code: Select all

AutoResponseType => 'auto reply',
ForceNotificationToUserID => '',
OrigHeader => {
'From' => $OTRS_CustomerFrom,
'To' => $OTRS_Queue,
'Subject' => $OTRS_Subject,
'Body' => $OTRS_Body,
},
Prod: Ubuntu Server 16.04 / Zammad 1.2

DO NOT PM ME WITH OTRS RELATED QUESTIONS! ASK IN THE FORUMS!

OtterHub.org
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

SOAP - Neuen Artikel erstellen?

Post by jojo »

ne, wonders funzt es auch.... schick mir mal per PN oder mail Deinen Code....
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Locked