3

I'm new to OTRS (3.2) and also new to PERL but I have been given the task of setting up OTRS so that it will make a call to our remote webservice so a record can be created on our end when a ticket is set as "Closed". I set up various dynamic fields so the customer service rep can fill in additional data that will be passed into the webservice call along with ticket details. I couldn't get the webservice call to trigger when the ticket was "Closed" but I did get it to trigger when the "priority" was changed so I'm just using that now to test the webservice. I'm just using the Test.pm and TestSimple.pm files that were included with OTRS.

When I look at the Debugger for the Webserice, I can see that the calls were being made:

   $VAR1 = {
      'TicketID' => '6'
   };

My webservice currently just has one method "create" which just returns true for testing.

however I get the following from the Test.pm

"Got no TicketNumber (2014-09-02 09:20:42, error)"

and the following from the TestSimple.pm

"Error in SOAP call: 404 Not Found at /TARGET/SHARE/var/otrs/Kernel/GenericInterface/Transport/HTTP/SOAP.pm line 578 (2014-09-02 09:20:43, error)

I've spent countless hours on Google but couldn't find anything on this. All I could find is code for the Test.pm and TestSimple.pm but nothing really helpful to help me create a custom invoker for my needs and configure the webservice in OTRS to get it to work.

Does anyone have any sample invokers that I can look at to see how to set it up?

Basically I need to pass the ticket information along with my custom dynamic fields to my webservice. From there I can create the record on my end and do whatever processing. I'm not sure how to setup the Invoker to pass the necessary ticket fields and dynamic fields and how to make it call a specific method in my remote webservice.

I guess getting the Test.pm and TestSimple.pm to work is the first step then I can modify those for my needs. I have not used PERL at all so any help is greatly appreciated.

Guest
  • 381
  • 2
  • 7
  • 22

1 Answers1

0

I'm also struggling with similar set of requirements too. I've also never programmed in PERL, but I can tell you at least that the "Got no TicketNumber" in the Test.pm is right from the PrepareRequest method, there you can see this block of code:

# we need a TicketNumber
if ( !IsStringWithData( $Param{Data}->{TicketNumber} ) ) {
   return $Self->{DebuggerObject}->Error( Summary => 'Got no TicketNumber' );
}

You should change all references to TicketNumber to TicketID, or remove the validation whatsoever (also there is mapping to ReturnedData variable).

Invoking specific methods on your WS interface is quite simple (but poorly documented). The Invoker name that you specify in the "OTRS as requester" section of web service configuration corresponds to the WS method that will be called. So if you have WS interface with a method called "create" just name the Invoker "create" too.

As far as the gathering of dynamic field goes, can't help you on that one yet, sorry.

Cheers

JanM
  • 1,385
  • 1
  • 15
  • 25