OTRS – Web Services from 3.1.2 to 3.1.4+

OTRS,Web Services,Web Stuff — Jeff Eske on June 6, 2012 at 3:21 pm

UPDATE:  I’ve now created sample files and posted a quick run-through on what’s needed to use them.

When OTRS was upgraded from 3.1.2 to 3.1.4, it seemed that web services were broken.  After upgrading, my form-to-ticket processing page quit working.  I did some investigating within OTRS documentation, as well as looking at the included rpc-example.pl script to see if I could figure out what, if anything, had changed.  I went back out to their site and looked at the release notes for 3.1.4 to see if it could shed any light on the situation.  Well, in the release notes, it indicates that it fixes “Bug#8363 – SOAP Transport can’t send a value ‘0’”.   “OK then”, I say.  They did something with the web services and broke something else.  Since I knew 3.1.2 web services worked, and I needed them, I just stuck with 3.1.2.

It’s been a few weeks now and they’ve released 3.1.5 and 3.1.6 now.  I decided to download 3.1.6 and see if they “fixed” the web services problem.  Well, after upgrading my system to 3.1.6, web services STILL didn’t work!  Well, either they didn’t really care about web services, or I was missing something!

I started digging into things and found that, from what I can tell, there are now numerous other values that need to be passed in to successfully create a new ticket (not an article) via web services.  Also, as far as I can tell, the the rpc-example.pl script and the documentation haven’t been updated to indicate that.  Ive included “before” 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.

Code that worked BEFORE 3.1.4

[CODE:]

$TicketID = $client->__soapCall(
“Dispatch”, array($username, $password,
“TicketObject”, “TicketCreate”,
“Title”,        $title,
“Queue”,        “Raw”,
“Lock”,         “Unlock”,
“PriorityID”,   1,
“State”,        “new”,
“CustomerUser”, $from,
“CustomerID”, “some ID”,
“OwnerID”,      1,
“UserID”,       1,
));

[/CODE:]

Code that works for 3.1.6 (I skipped 3.1.4 and 3.1.5, but I assume it works there also.  I’ll test to see):

[CODE:]

$TicketID = $client->__soapCall(
“Dispatch”, array($username, $password,
“TicketObject”, “TicketCreate”,
“Title”,        $title,
“TypeID”,    2,
“QueueID”,   2,
“LockID”,  1,
“PriorityID”,   2,
“State”,        “new”,
“CustomerUser”, $from,
“CustomerID”, “some ID”,
“OwnerID”,      1,
“UserID”,       1,
));

[/CODE:]

Note that I had to add TypeID, change Queue to QueueID and Lock to LockID, all with corresponding ids from the database.  Whether this is the ONLY solution or not, I don’t know, but it did get things back to where I can submit via web services again.

Jeff Eske

8 Comments

  1. […] have been broken, but they changed some of what needs to be passed in to be successful – see Web services from 3.1.2 to 3.1.4+ for details. Share […]

  2. […] web services in OTRS.  I’ve written a couple of entries about this in the past.  One covers changes in the services from 3.1.2 to 3.1.4.  In the other entry, I briefly described how easy it is to create tickets via web services.  […]

  3. hi Jeff,

    I was using web services, i realized that there is no webservices for CMDB. Can you help me in developing web services for CMDB (CI).

    Thansks
    Cornelius

    Comment by Cornelius — August 23, 2012 @ 11:25 pm
  4. Cornelius,

    That sounds like it could be a pretty big project. What are you wanting to do with the CMDB and web services?

    Jeff

    Comment by Jeff Eske — August 24, 2012 @ 8:43 am
  5. I was trying to Create and Update operations of CI through webservices.

    Thanks
    Cornelius

    Comment by Cornelius — August 24, 2012 @ 10:24 am
  6. I was trying to create/update CI’s using webservices.

    Comment by Cornelius — August 24, 2012 @ 11:04 pm
  7. Yeah, that would take a fair amount of work. I’m afraid that would be beyond what I’m currently up for. Sorry.

    Jeff

    Comment by Jeff Eske — August 27, 2012 @ 9:45 am
  8. One thing that you CAN use to create CIs “automatically” is use the import/export function to bring in files from another system. I’ve been experimenting with using that to tie LANDesk to our OTRS system.

    Jeff

    Comment by Jeff Eske — August 28, 2012 @ 9:17 am

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. | Jeff's Blog