[SOLVED] Creating or Importing Services

English! place to talk about development, programming and coding
Post Reply
baldassare
Znuny newbie
Posts: 12
Joined: 19 Mar 2014, 12:09
Znuny Version: OTRS 3.2.10

[SOLVED] Creating or Importing Services

Post by baldassare »

Hi,
we were wondering if there is any way to create services via Soap call or web service.

We have our CRM having users with their services and we would import that in OTRS automatically.
I saw after reading API list, that there are some API for service creation in Kernel::System::Service like ServiceAdd.

Is there any way to call this API remotly?

Hope you can help.
Thanks in advance
Last edited by baldassare on 20 Sep 2016, 10:59, edited 1 time in total.
-BG-
  • programmer
    web developer
baldassare
Znuny newbie
Posts: 12
Joined: 19 Mar 2014, 12:09
Znuny Version: OTRS 3.2.10

Re: Creating or Importing Services

Post by baldassare »

Hi all,
I have modified the file in /opt/otrs/bin/cgi-bin adding the following line

Code: Select all

....
use Kernel::System::Service;
.....
$CommonObject{TimeObject}            = $Kernel::OM->Get('Kernel::System::Time');
$CommonObject{UserObject}             = $Kernel::OM->Get('Kernel::System::User');
# ADDED ROW
$CommonObject{ServiceObject}        = $Kernel::OM->Get('Kernel::System::Service');
....
After this changes the soap call in php:

Code: Select all

$ServiceList = $client->__soapCall("Dispatch",
array($username, $password,
"ServiceObject", "ServiceList",
"UserID", "1"
));
returns the list of services rightly.
I am afraid that this way of customization is not optimal and after an upgrade of OTRS this changes could be overwritten.
Is there any alternative way to obtain same result or I'm following the right way?

Thank in advance
-BG-
  • programmer
    web developer
baldassare
Znuny newbie
Posts: 12
Joined: 19 Mar 2014, 12:09
Znuny Version: OTRS 3.2.10

Re: Creating or Importing Services

Post by baldassare »

Hi all,
the only way I found (due to the ton of answers to my quesitons) is to write a perl script using the rich and well documented OTRS API.

Regards
-BG-
  • programmer
    web developer
Post Reply