OTRS Soap Interface

Contents

Disclaimer: This are my first trys with the Soap Interface. If you’ve got better information just send it to me or post a comment, I will gladly update this documentation. I just wrote this article because there is almost no information about the OTRS Soap-Interface on the web. Perhaps it helps someone.

At first it is necessary to set the Soap user and password:

  1. - Login into your existing OTRS Installation as Admin
  2. - in the Menu under “Admin”->“Sysconfig” set Group to “Framework” and click “show”
  3. - In the list of subgroups click “Core::SOAP”
  4. - Check the boxes for SOAP::User: and SOAP::Password: and enter the values you like
  5. - click update

Now you can use the OTRS Functions over SOAP.

At my test installation the Setting of the username and password over the admin-interface didn’t work at all. I had to enter it manually in the rpc.pl, but normally I think it should work.

You find a documentation of the OTRS-Modules/Functions you can use here:

http://dev.otrs.org/

The invocation of a Module/Function works like follows:

$RPC->Dispatch($User, $Pw, 'Module','Function', Parameter);

A good start is the rpc-example.pl, which you find in the folder scripts of your OTRS-Install. I modified the example a bit to create a ticket. No guarantee that this doesn’t crash your database, so don’t try on a live system.

scripts/rpc-example.pl

use SOAP::Lite('autodispatch', proxy => 'http://localhost/otrs/rpc.pl');
my $User = 'exampleuser';
my $Pw = 'examplepass';
my $RPC = Core->new();
# create a new ticket number
my $TicketNumber = $RPC->Dispatch($User, $Pw, 'TicketObject','TicketCreateNumber');
print "RPC: New Ticketnumer created: ".$TicketNumber."\n";
my $TicketId = $RPC->Dispatch($User, $Pw, 'TicketObject', 'TicketCreate',
       TN => $TicketNumber,
       Title => 'Test Ticket',
       Queue => 'Raw',                # or QueueID => 123,
       Lock => 'unlock',
       PriorityID => 2,         # or PriorityID => 2,
       State => 'open',                # or StateID => 5,
       CustomerUser => 'customer at example.com',
       OwnerID => 1, # new owner
       ResponsibleID => 1, # new responsible
       UserID => 1,
);
print "RPC: New Ticket id is: $TicketId\n";
my $ArticleID =$RPC->Dispatch($User, $Pw, 'TicketObject', 'ArticleSend',
        TicketID         => $TicketId,
        ArticleType      => 'email-external',                   # email-external|email-internal|phone|fax|...
        SenderType       => 'agent',                           # agent|system|customer
        From             => 'root',  # not required but useful
        To               => 'customer', # not required but useful
        Cc               => '', # not required but useful
        ReplyTo          => '', # not required
        Subject          => 'Test Ticket',          # required
        Body             => "Test Body",                # required
        MessageID        => '',     # not required but useful
        Charset          => 'ISO-8859-15',
        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
    );

Of course this works in PHP too. The task i wanted to do is send an e-mail to a user and simultaneously create a ticket in otrs. This is the ticket creation process in otrs:

  • create a new ticketnumber
  • create a new ticket with that number
  • attach a message (called article) to the ticket, which at once is sent out per mail

Of course the last step can vary. if you don’t want to send an e-mail for example.

# WARNING: This could destroy your OTRS-Database, please use only for testing and as a starting point for your own developments

$user = "testuser";
$pass = "testpass";
$url = "http://localhost/otrs/rpc.pl"  # replace with your own otrs url

# initialising soap client
$soapclient = new SoapClient(null, array('location'  => $url,
                             'uri'       => "Core",
                             'trace'     => 1,
                             'login'     => $user,
                             'password'  => $pass,
                             'style'     => SOAP_RPC,
                             'use'       => SOAP_ENCODED));

# creating a ticket number
$ticketnr = $soapclient->__soapCall("Dispatch", array($user, $pass, "TicketObject", "TicketCreateNumber"));

#php changes long numbers to 123E+10 notation to prevent this screwing up our ticketnumbers we convert notation
#it into normal plain numbers. but only if not string, because sometimes you have a string addition like XY123 on your
#ticket numbers
if(! is_string($ticketnr) ) $ticketnr = number_format($ticketnr,0, '.', '');

# create the new ticket
$title = "some test title";
$queue = "support";
$customerid = "1234567";
$customeruser = "John Doe";
$userid = 3;   # your OTRS-Userid, varies of course in every installation

$ticketid = $soapclient->__soapCall("Dispatch", array($user, $pass, "TicketObject", "TicketCreate",
									       "TN", $ticketnr,
									       "Title", "[ Ticket#: ".$ticketnr." ] ".$title,
									       "Queue", $queue,
									       "Lock" , "unlock",
									       "PriorityID", 5,
									       "State" , "closed successful",
									       "CustomerId", $customerid,
									       "CustomerUser", $customeruser,
									       "OwnerID" , $userid,
									       "UserID", $userid
									       ));

#create the new e-mail message, which is send out and attached to the ticket automatically

$from = "support@example.com";
$to = "janedoe@example.com";
$message = "pay your bills";
$subject = "testmessage";

$articleid = $soapclient->__soapCall("Dispatch", array($user, $pass, "TicketObject", "ArticleSend",
				    "TicketID"         , $ticketid,
			        "ArticleType"      , "email-external",
			        "SenderType"      , "agent",
			        "From"             , $from,
			        "To"               , $to,
			        "ReplyTo"          , "",
			        "Subject"          , "[ Ticket#: ".$ticketnr." ] ".$subject,
			        "Body"             , $message,
			        "ContentType"      , "text/plain; charset=utf-8",
			        "Charset"          , "utf-8",
			        "HistoryType"      , "EmailCustomer",
			        "HistoryComment"   , "generated by OTRSInterface-Class",
			        "UserID"           , $userid,
			        "NoAgentNotify"    , 0,
			        "MimeType"             , "text/plain",
			        "Loop"             , 0
			    	));

Of course this is just a very basic example. You can really use any OTRS-Class over the SOAP-Interface, just read the API. I realized, that some of the Objects are not created correctly in rpc.pl. So just add the additonal ones you need:

use Kernel::System::Group;
use Kernel::System::Queue;   # this one I added by myself
use Kernel::System::Ticket;

# ... some more code

$CommonObject{GroupObject} = Kernel::System::Group->new(%CommonObject);
$CommonObject{QueueObject} = Kernel::System::Queue->new(%CommonObject);  # you have to add this too
$CommonObject{TicketObject} = Kernel::System::Ticket->new(%CommonObject);

If you have still some questions, just ask.

Deutsche Version: OTRS Soap Schnittstelle

In den Kommentaren wurden anscheinend ein paar Fehler gefixt. Ich konnte die Vorschläge bis jetzt noch nicht testen und habe daher das Tutorial noch nicht geändert. Also werft auch einen Blick auf die Kommentare

Hinweis: Dies sind meine ersten Versuche mit der Soap-Schnittstelle von OTRS. Falls jemand mehr und vor allem bessere Informationen hat, bitte melden. Ich habe meine Erfahrungen nur kurz dokumentiert, da dies eventuell anderen Personen einen leichteren Einstieg in die sehr schlecht dokumentierte Schnittstelle verschafft.

Zunächst ist es erforderlich den Soap-Username und das Soap-Password zu setzen.

  1. Login als Admin
  2. Im Menü unter “Admin”->“Sysconfig” als Group “Framework” einstellen und “show” klicken
  3. In der Liste der Subgroups auf “Core::SOAP klicken
  4. Bei SOAP::User: und SOAP::Password: jeweils das Häckchen setzen und entsprechende Werte in die Felder eintragen
  5. auf “Aktualisieren” klicken

Nun kann man per SOAP die “normalen” OTRS Funktionen nutzen. Bei meiner Testinstallation funktionierte das Setzen der Passwörter nicht richtig und ich musste sie manuell in der rpc.pl setzen. Dies sollte aber normalerweise nicht nötig sein. Eine Dokumentation der OTRS-Module/Funktionen findet man hier:

http://dev.otrs.org/

Soap-Beispiel mit Perl

Der Aufruf der Module funktioniert dabei wie folgt:

$RPC->Dispatch($User, $Pw, 'Modul','Funktion', Parameter);

Ein guter Start ist die rpc-example.pl, welche im Ordner scripts der OTRS-Installation zu finden ist. Hier ein etwas modifiziertes Beispiel um ein Ticket zu erstellen. Es gibt keine Garantie, das das funktionieren wird. Also bitte nicht am Live-System testen, eventuell zerschießt das die Datenbank.

scripts/rpc-example.pl

use SOAP::Lite('autodispatch', proxy => 'http://localhost/otrs/rpc.pl');
my $User = 'exampleuser';
my $Pw = 'examplepass';
my $RPC = Core->new();
# create a new ticket number
my $TicketNumber = $RPC->Dispatch($User, $Pw, 'TicketObject','TicketCreateNumber');
print "RPC: New Ticketnumer created: ".$TicketNumber."\n";
my $TicketId = $RPC->Dispatch($User, $Pw, 'TicketObject', 'TicketCreate',
       TN => $TicketNumber,
       Title => 'Test Ticket',
       Queue => 'Raw',                # or QueueID => 123,
       Lock => 'unlock',
       PriorityID => 2,         # or PriorityID => 2,
       State => 'open',                # or StateID => 5,
       CustomerUser => 'customer at example.com',
       OwnerID => 1, # new owner
       ResponsibleID => 1, # new responsible
       UserID => 1,
);
print "RPC: New Ticket id is: $TicketId\n";
 my $ArticleID =$RPC->Dispatch($User, $Pw, 'TicketObject', 'ArticleSend',
        TicketID         => $TicketId,
        ArticleType      => 'email-external',                   # email-external|email-internal|phone|fax|...
        SenderType       => 'agent',                           # agent|system|customer
        From             => 'root',  # not required but useful
        To               => 'customer', # not required but useful
        Cc               => '', # not required but useful
        ReplyTo          => '', # not required
        Subject          => 'Test Ticket',          # required
        Body             => "Test Body",                # required
        MessageID        => '',     # not required but useful
        Charset          => 'ISO-8859-15',
        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
    );

Soap-Beispiel mit PHP

Mit PHP kann man die Schnittstelle natürlich genauso ansteuern. Der Plan war
e-mails an Kunden zu versenden und gleichzeitig ein geschlossenes Ticket im OTRS zu erzeugen
um eine Dokumentation der Mails zu haben und bei Antworten der Kunden sofort den
Originaltext angezeigt zu bekommen.

So läuft die Ticketerzeugung in OTRS ab:

  • eine neue Ticketnummer erzeugen
  • ein neues Ticket mit der erzeugten Nummer generieren
  • eine Nachricht (=article) an das Ticket anhängen, die Nachricht wird (im
    Beispiel) sofort per Mail verschickt

Der letzte Schritt kann natürlich variieren je nachdem was man machen will. Zum
Beispiel kann man auch einfach keine e-mails versenden (muss dann natürlich aber
andere Funktionen als im Beispiel benutzen).

# Vorsicht: Dieser Code könnte die OTRS-Datenbank zerstören. Niemals am
# Produktiv-System testen, sondern nur als Basis für eigenen Tests nutzen

$user = "testuser";
$pass = "testpass";
$url = "http://localhost/otrs/rpc.pl"  # URL zum rpc.pl Modul

# Soap-Client initialisieren
$soapclient = new SoapClient(null, array('location'  => $url,
                             'uri'       => "Core",
                             'trace'     => 1,
                             'login'     => $user,
                             'password'  => $pass,
                             'style'     => SOAP_RPC,
                             'use'       => SOAP_ENCODED));

# Ticketnummer erstellen
$ticketnr = $soapclient->__soapCall("Dispatch", array($user, $pass, "TicketObject", "TicketCreateNumber"));

#php changes long numbers to 123E+10 notation to prevent this screwing up our ticketnumbers we convert notation
#it into normal plain numbers. but only if not string, because sometimes you have a string addition like XY123 on your
#ticket numbers
# php ändert lange Zahlen in die wissenschaftliche Potenz-Notation 123E+10 z.B.
# . Um zu verhindern, dass komische Ticketnummern erzeugt werden wird die
# Ticketnummer in eine ausgeschriebene Zahl umgewandelt. Falls OTRS die
# Ticketnummern mit Präfix ausstattet sollte die Umwandlung nicht funktionieren.
# Deshalb wird vorher überprüft ob die Ticketnummer eine Zahl ist.
if(! is_string($ticketnr) ) $ticketnr = number_format($ticketnr,0, '.', '');

# Neues Ticket erstellen
$title = "some test title";
$queue = "support";
$customerid = "1234567";
$customeruser = "John Doe";
$userid = 3;   # Die OTRS-ID des Users, der die Tickets erstellen soll !! Dieser
Wert variiert natürlich in jeder Otrs-Installation

$ticketid = $soapclient->__soapCall("Dispatch", array($user, $pass, "TicketObject", "TicketCreate",
									       "TN", $ticketnr,
									       "Title", "[ Ticket#: ".$ticketnr." ] ".$title,
									       "Queue", $queue,
									       "Lock" , "unlock",
									       "PriorityID", 5,
									       "State" , "closed successful",
									       "CustomerId", $customerid,
									       "CustomerUser", $customeruser,
									       "OwnerID" , $userid,
									       "UserID", $userid
									       ));

# neue e-mail Nachricht generieren, welche automatisch versandt und dem Ticket
# hinzugefügt wird

$from = "support@example.com";
$to = "janedoe@example.com";
$message = "pay your bills";
$subject = "testmessage";
$articleid = $soapclient->__soapCall("Dispatch", array($user, $pass, "TicketObject", "ArticleSend",
				    "TicketID"         , $ticketid,
			        "ArticleType"      , "email-external",
			        "SenderType"      , "agent",
			        "From"             , $from,
			        "To"               , $to,
			        "ReplyTo"          , "",
			        "Subject"          , "[ Ticket#: ".$ticketnr." ] ".$subject,
			        "Body"             , $message,
			        "ContentType"      , "text/plain; charset=utf-8",
			        "Charset"          , "utf-8",
			        "HistoryType"      , "EmailCustomer",
			        "HistoryComment"   , "generated by OTRSInterface-Class",
			        "UserID"           , $userid,
			        "NoAgentNotify"    , 0,
			        "Type"             , "text/plain",
			        "Loop"             , 0
			    	));

Natürlich ist das nur ein ganz einfaches Beispiel. Man kann alle OTRS-Klassen
über das SOAP-Interface benutzen. Hier ist die API Gold wert. Manche Objekte werden in der
rpc.pl nicht korrekt erzeugt. Ich vermute mal weil die SOAP-Schnittstelle
noch nicht so fortgeschritten war, oder um Ressourcen zu sparen. Evtl. auch aus
Sicherheitsgründen. Ich habe einfach die Klassen hinzugefügt, welche ich
zusätzlich benötigt habe. Das sieht dann so aus:

use Kernel::System::Group;
use Kernel::System::Queue;   # Eine hinzugefügte Zeile, wichtig auch der Part
weiter unten
use Kernel::System::Ticket;

# ... hier steht noch mehr Code, dann kommen folgende Zeilen

$CommonObject{GroupObject} = Kernel::System::Group->new(%CommonObject);
$CommonObject{QueueObject} = Kernel::System::Queue->new(%CommonObject);  # Die
Zeile muss ebenfalls hinzugefügt werden, das Schema um weitere Objekte
hinzuzufügen sollte nun klar sein
$CommonObject{TicketObject} = Kernel::System::Ticket->new(%CommonObject);

Falls es noch Fragen gibt versuch ich die gerne zu beantworten.

37 comments

Archived from the original WordPress blog. Comments are closed.

  1. johpie
    Some Calls need an Array in an Array for example ArticleSend with Sign, Attachment and so on. How can I realise this with PHP?
    1. admin
      Good question. I didn’t try it yet, but on monday I’ll do some tests and further investigation. If meanwhile you already found the solution please post it here, too.
  2. johpie

    I don’t know my mistake at first time, but it is very simple. For example:

    “OrigHeader”, array(
    ‘From’ => $customerMail,
    ‘To’ => $toAdress,
    ‘Subject’ => $title,
    ‘Body’ => $body
    )

    Btw. you need to set OrigHeader when you want to use the auto-replay function of OTRS.

  3. Sebastian

    Hi,
    netter Artikel, allerdings habe ich Probleme mit sonderzeichen. Egal in welchem Encoding ich Strings übertrage, OTRS quittiert mit diese nur mit Salat. Gibt es Erfahrungen mit UTF-8?

    Grüße!

    1. admin
      Also wichtig war bei uns, dass OTRS und e-mail das gleiche Charset haben. z.B. bei dem Perl-Beispiel ist als Mail-Charset ISO-8859-15 eingestellt, bei dem php-Beispiel ist es utf-8, also da evtl. vorsichtig sein. Anfangs hatte es bei mir mit den Umlauten auch nicht geklappt, da unser OTRS auf utf-8 lief, ich die Mail aber in iso versendet hatte. Nach einer kleinen Umstellung auf Mail-Charset utf-8 funktionierte alles perfekt.
  4. André

    Hi.

    Ich habe gerade mal den Perl Part für den Article unter OTRS 2.4.4 probiert, indem ich es der rpc-example.pl hinzugefügt habe.

    Es wird zwar ein Ticket angelegt aber kein Article erzeugt.

    Hast du ne Idee warum?

    Danke im Voraus.

    MfG
    André

  5. André
    “Type” muss in “MimeType” umebnannt werden, dann gehts….
  6. Linga
    what ever the things u hav said is all perfect in rpc-example.pl and rpc.pl… stii if i run the php code i get an error
    “Fatal error: Uncaught SoapFault exception: [soap:Client] Application failed during request deserialization: no element found at line 1, column 0, byte -1 at /usr/lib/perl5/XML/Parser.pm line 187 in /var/www/lp/soap2.php:30 Stack trace: #0 /var/www/lp/soap2.php(30): SoapClient->__soapCall(‘Dispatch’, Array) #1 {main} thrown in /var/www/lp/soap2.php on line 30”
  7. admin

    Linga: I read a forum-thread you posted in another forum, and they gave you this link

    http://wiki.anothergeek.ca/tiki-index.php?page=PHPOTRSSOAP

    Did this solve your problem? Would be nice if you leave some comment, perhaps someone else has the same problem.

  8. Boris
    I get this error in PHP
    “Fatal error: Class ‘SoapClient’ not found …”
    What should I include within PHP script to get it work?
    1. admin

      You have to install the soapclient libraries for PHP, they have to be in your Standard-PHP-Classpath, then it should work.

      for example under debian something like this should be sufficent:
      apt-get install php-soap

  9. Boris
    Thanks! It works!
  10. Hello,

    Hello I m new to using Web services like soap. I have to integrate OTRs in magento , when we enter contact us details .. that details we have to pass in OTRS to create ticket.

    I have question regarding rcp.pl file.. where we have to place that file and “Dispatch” function definition - i can’t understand where this function is created.Is that function is in OTRS system or we have to create in php.

    I am getting error “No operation Dispatch in WSDL”
    I have used code from this link :: “http://wiki.otrs.org/index.php?title=Create_a_ticket_in_OTRS_from_PHP_via_RPC"

    Awaiting for your reply… Plz help me to solve this issue.

    Thanks,
    Bijal Bhavsar

    1. admin

      The file rpc.pl is part of otrs and is the SOAP-Interface to OTRS. It is important, that you enter the correct URL to the rpc.pl file. Perhaps you can post your php code snippet. I’m pretty sure you put a wrong URL here:

      $url = “http://example.com/otrs/rpc.pl";

      This has to be replaced to the file in your OTRS-Installation

  11. Tatjana

    Hello!

    I am very new to OTRS and Perl as well :). I have a problem, and I cannot find any solutions for it in Internet. Sorry this question has some small relationship with the theme above.

    I want to call Web-Services from OTRS (this Web-Service has to be wroten in php and has to save new customer in our own DB). I try in Kernel/Config.pm in a place where I build insert query to call this Perl script:

    use HTTP::Request::Common;
    $ua = LWP::UserAgent->new;
    $ua->request(POST \http://_host_/index.php\, [foo => \bar\, bar => \foo\]);
    system(\php \.$ua);

    after that I try to add a new Customer by Customer form and get this kind of error:

    Software error: Undefined subroutine &Kernel::System::CustomerUser::DB::_ConvertTo called at /opt/otrs//Kernel/Config.pm line 594.

    How can I call any Web-Service FROM OTRS and give some parameters to it per Post?

    Thank you very much,
    Tatjana

  12. admin

    Hi,

    I don’t know if OTRS offers this possibility in Config.pm. If it doesn’t work, perhaps you can try inserting your code directly in the file “Kernel/System/CostumerUser.pm” in the function: CustomerUserAdd.

    Or perhaps it is a option for you to use the OTRS-Costumer-Backend-Feature:
    http://doc.otrs.org/2.4/en/html/x1813.html

    This would be a example for your LWP-Call. The system(php …) call is not needed.

    use HTTP::Request::Common qw(POST);
    use LWP::UserAgent;
    $ua = LWP::UserAgent->new;
    my $req = (POST ‘http://www.example.com/cgi-bin/process.cgi',
    [“PARAM1” => “foo”,
    “PARAM2” => “bar”,
    “PARAM3” => “coo”,
    “PARAM4” => “laa”]);
    $response_to_discard = $ua->request($req);

  13. Tatjana
    Thank you so much!
  14. Tatjana

    Hi again!

    I have other one problem :)
    I would like to use my own php script (webservise) that will do select, update and insert in our CustomerUser DB (I want to do so, in a case if our Customer DB will change in a time or even if it will be a simple XML file. For such DB operation I would like to use Propel, to be independet from DB structure).

    With your great help I can post and request the data to and from my webservise. Now I am looikng where I can just simply globaly change CustomerUserMap or so with data from our Customer DB to have this effect. Do you think is it possible? I am looking for it, but I can not find a right place for it.
    Would be great if you know and could help me.

    Thank you!
    Tatjana

  15. admin

    I think the easiest thing would probably be to just sync the data into a mysql-database and use the default database Customer-User-Backend

    http://doc.otrs.org/3.0/en/html/x2276.html

    If you want you can also write your own Costumer-User-Backend. You can find the default database-Backend under:

    Kernel/System/CustomerUser/DB.pm

    Perhaps you can use it as a template to your own User-Backend. But it looks like quite some work.

  16. Tatjana
    Thank you again! Have a nice day :)
  17. Tatjana

    Hi!

    Hier bin ich wieder :)
    Ich bitte Sie um die Hilfe!
    When ich im OTRS bin und dann auf Kunden drücke, ladet sich diese Seite evig lange, da ich viele Kunden habe.
    Im Suchfeld erscheint ein Sternchen, das dieses langsame Laden von der Seite verursacht. Das will ich nicht. Ich will, dass diese Seite erstmal ohne Kundenliste sich ladet.

    im AdminCustomerUser.dtl gibt es eine Zeile:

    Könnten Sie mir bitte helfen, wo $QData{“Search”} deklariert wird? ich kann nicht diese Stelle finden, wo ich das ändern kann.
    oder ist das orgendwo in der Einstellungen?

    Bei mir auf dem VM (Testversion) ladet sich die Kundenseite ohne Sternchen (Ohne Kundendaten). Auf der Liveversion mit… bis jetzt habe ich keinen Unterschied im Code gefunden.
    Ich denke, dass ich eine kleine Anstellung dafür auf VM gemacht habe. Ich denke, dass das irgenwo im Forum war… ich kann aber nicht mehr finden.

    Ich bin sehr dankbar im voraus!

    Mit Freundlichem Gruß,
    Tatiana

  18. Tatjana

    Hi!

    Hier bin ich wieder :)
    Ich bitte Sie um die Hilfe!
    When ich im OTRS bin und dann auf Kunden drücke, ladet sich diese Seite evig lange, da ich viele Kunden habe.
    Im Suchfeld erscheint ein Sternchen, das dieses langsame Laden von der Seite verursacht. Das will ich nicht. Ich will, dass diese Seite erstmal ohne Kundenliste sich ladet.

    im AdminCustomerUser.dtl gibt es eine Zeile:

    <input type=\text\ name=\Search\ value=\$QData{\Search\}\ id=\Search\ title=\$Text{\Search\}\/>

    Könnten Sie mir bitte helfen, wo $QData{\Search\} deklariert wird? ich kann nicht diese Stelle finden, wo ich das ändern kann.
    oder ist das orgendwo in der Einstellungen?

    Bei mir auf dem VM (Testversion) ladet sich die Kundenseite ohne Sternchen (Ohne Kundendaten). Auf der Liveversion mit… bis jetzt habe ich keinen Unterschied im Code gefunden.
    Ich denke, dass ich eine kleine Anstellung dafür auf VM gemacht habe. Ich denke, dass das irgenwo im Forum war… ich kann aber nicht mehr finden.

    Ich bin sehr dankbar im voraus!

    Mit Freundlichem Gruß,
    Tatiana

  19. Tatjana
    Ich habe die Antwort gefunden:
    Dann editiere die Datei Kernel/Modules/AdminCustomerUser.pm, dort gibt
    es eine Zeile:
    my $Search = $Self->{ParamObject}->GetParam( Param => ‘Search’ ) || ‘*’;
    Hier reicht es aus das Sternchen zu entfernen.
    my $Search = $Self->{ParamObject}->GetParam( Param => ‘Search’ ) || ‘’;
  20. Pitchblack

    Hello,
    I am running the perl script that you posted remotely with the correct url. The script seems to call soap and post a ticket to the OTRS server, but there is something wrong. After I click on the RAW queue there is a row where the ticket is listed but all that data is missing. After I click on the ticket there is an error. What is going on?

    $("#FixedTable tbody tr.Active").offset() is null

    (?)([object Object])@http://sdstarlabotrs/otrs-web/js/js-cache/ModuleJS_d4dadc7d727479f12302f928ec003e30.js:97
    (?)()@http://sdstarlabotrs/otrs/index.pl?Action=AgentTicketZoom;TicketID=2:533
    Ready((function (j, s) {return new b.fn.init(j, s);}))@http://sdstarlabotrs/otrs-web/js/js-cache/CommonJS_135c8f5270a616743e81ff0eaeec77a0.js:580
    trigger()@http://sdstarlabotrs/otrs-web/js/js-cache/CommonJS_135c8f5270a616743e81ff0eaeec77a0.js:37
    trigger([object Event])@http://sdstarlabotrs/otrs-web/js/js-cache/CommonJS_135c8f5270a616743e81ff0eaeec77a0.js:37

  21. mihail

    Hi!
    I’ve tried to create a ticket as shown in the example but I got the following error on the OTRS 3.0 side

    Sep 8 12:19:25 neteye-mon OTRS-RPC-10[7630]: [Notice][Kernel::System::Ticket::TicketCreate] New Ticket [2011090810000126/rpc-example.pl ] created (TicketID=35,Queue=Helpdesk,Priority=3 normal,State=new)
    Sep 8 12:19:40 neteye-mon OTRS-CGI-10[7726]: [Error][Kernel::System::Ticket::Article::ArticleLastCustomerArticle][Line:1166]: No article found for TicketID 35!
    Sep 8 12:19:40 neteye-mon OTRS-CGI-10[7726]: [Error][Kernel::System::Ticket::TicketSubjectClean][Line:827]: Need TicketNumber!
    Sep 8 12:19:40 neteye-mon OTRS-CGI-10[7726]: [Error][Kernel::System::Ticket::TicketPermission][Line:3203]: Need TicketID!
    Sep 8 12:19:40 neteye-mon OTRS-CGI-10[7726]: [Error][Kernel::System::Ticket::TicketPermission][Line:3203]: Need TicketID!
    Sep 8 12:19:40 neteye-mon OTRS-CGI-10[7726]: [Error][Kernel::System::Ticket::TicketPermission][Line:3203]: Need TicketID!
    Sep 8 12:19:40 neteye-mon OTRS-CGI-10[7726]: [Error][Kernel::System::Ticket::TicketPermission][Line:3203]: Need TicketID!
    Sep 8 12:19:40 neteye-mon OTRS-CGI-10[7726]: [Error][Kernel::System::User::GetUserData][Line:150]: Need User or UserID!
    Sep 8 12:19:40 neteye-mon OTRS-CGI-10[7726]: [Error][Kernel::System::Ticket::TicketFlagGet][Line:7545]: Need TicketID!

    On the client side all seems to be OK!

    RPC: New Ticketnumer created: 2011090810000117
    RPC: New Ticket id is: 35

    Some help please !

  22. AaronM

    The sample code for perl provided has some issues with integration into a bigger system due to the use of autodispatch, which while convenient is not really a great idea. This code avoids autodispatch and accomplishes the same thing in a way that can be used with other modules. In particular we found that Moose and autodispatch do not get along.

    #!/usr/bin/perl
    use SOAP::Lite;

    my $User = ’exampleuser’;
    my $Pw = ’examplepass';

    my $otrs = new SOAP::Lite( proxy => ‘http://localhost/otrs/rpc.pl’,uri=> ‘http://localhost/Core’);
    my $som; #SOAP message

    # create a new ticket number
    $som = $otrs->Dispatch($User, $Pw, ‘TicketObject’,‘TicketCreateNumber’);
    die $som->fault->{faultstring} if $som->fault;
    my $TicketNumber = $som->result;
    print “RPC: New Ticketnumer created: “.$TicketNumber."\n”;

    $som = $otrs->Dispatch($User, $Pw, ‘TicketObject’, ‘TicketCreate’,
    TN => $TicketNumber,
    Title => ‘Test Ticket’,
    Queue => ‘Raw’, # or QueueID => 123,
    Lock => ‘unlock’,
    PriorityID => 2, # or PriorityID => 2,
    State => ‘open’, # or StateID => 5,
    CustomerUser => ‘customer at example.com’,
    OwnerID => 1, # new owner
    ResponsibleID => 1, # new responsible
    UserID => 1,
    );
    die $som->fault->{faultstring} if $som->fault;
    my $TicketId = $som->result;
    print “RPC: New Ticket id is: $TicketId\n”;

    $som =$otrs->Dispatch($User, $Pw, ‘TicketObject’, ‘ArticleSend’,
    TicketID => $TicketId,
    ArticleType => ’email-external’, # email-external|email-internal|phone|fax|…
    SenderType => ‘agent’, # agent|system|customer
    From => ‘root’, # not required but useful
    To => ‘customer’, # not required but useful
    Cc => ‘’, # not required but useful
    ReplyTo => ‘’, # not required
    Subject => ‘Test Ticket’, # required
    Body => “Test Body”, # required
    MessageID => ‘’, # not required but useful
    Charset => ‘ISO-8859-15’,
    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
    );
    die $som->fault->{faultstring} if $som->fault;
    my $ArticleID = $som->result;
    print “RPC: New Article id is: $ArticleID\n”;

  23. Harry

    Hm, im PHP-Beispiel ist an keiner Stelle $subject definiert, Fehlermeldung:

    Notice: Undefined variable: subject in C:\xampp\htdocs\test\soap-otrs.php on line 68

  24. admin
    danke für den Hinweis habe es gerade im Code ergänzt
  25. Daniel
    has anyone had any luck connecting to OTRS .NET Studio? Preferably VB? If so, how???
  26. […] and “after” examples below.  I don’t remember for sure anymore, but I think that this blog post was my starting point for creating my original processing page. Share […]
  27. Hi,

    I have created a module in drupal, in case if some one want to integrate users in drupal based CMS as OTRS Customer Users.
    http://drupal.org/project/otrs

  28. How to close a ticket via PHP and SOAP?

    I have a this code, but I don’t know how is ticketObject etc.

    $datos= array($this->_username, $this->_password,
    “TicketObject”, “TicketCreate”,
    “TicketID”, $ticketid,
    “TicketNumber”, $ticketnumber,
    “State”, “close”,
    “UserID”, 1,
    //“Ticket”=> array(“State”, “closed”),
    );

  29. tripti
    what ever the things u hav said is all perfect in rpc-example.pl and rpc.pl on windows otrs installation… but on unix i am unable to access the rpc.pl file and still if i run the php code i get an error
    “Fatal error: Uncaught SoapFault exception: [soap:Client] Application failed during request deserialization: no element found at line 1, column 0, byte -1 at /usr/lib/perl5/XML/Parser.pm line 187 in /var/www/lp/soap2.php:30 Stack trace: #0 /var/www/lp/soap2.php(30): SoapClient->__soapCall(‘Dispatch’, Array) #1 {main} thrown in /var/www/lp/soap2.php on line 30″
  30. Danil
    I need create ticket in otrs with attachment file. How can i get this? Thanks.
  31. Martin

    There is a published code for the attachments in the Otterhub-forums:

    http://forums.otterhub.org/viewtopic.php?p=53866#p53866

  32. Stefan

    Hallo,

    ich versuche mit PHP Tickets anzulegen - klappt so weit.
    Wie kann ich die “Wartezeit” bei Tickets mit dem Status “Warten auf Erinnerung” mit angeben?

    Vielen Dank

  33. Stefan

    Hallo zusammen,

    Ich kann mittlerweile wunderbar Tickets in OTRS via SOAP anlegen und erhalte die TicketID zurück.
    Leider schaffe ich es trotz vieler Tests nicht, eine Erinnerungszeit bei Tickets mit “Warten auf…"-Status zu hinterlegen.
    Kann mir jemand den Trick verraten?

    Wäre super - vielen Dank