Create/update case from backend

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #3799
    redberg
    Member

    Hi,
    I need to build an integration from our monitoring platform. I want to both create & update tickets in POB (G6). So when creating, I need to receive the ticket ID in the command result – so that I later can update the ticket using the ticket ID as parameter.

    Where do I find documentation on best ways to “talk to POB” from backend. webservices, SQL or what ever..

    Best Regards

    Roberth Edberg, ATG

    #3800
    Stefan Reichelt
    Participant

    Hi,

    The most reliable way are webservices, I guess. You’ll get the ticket ID back immediately (if not, you will see why), and you can use the methods of the web framework to update cases (and all other entities) at any time. The Wendia whitepaper “POB G6 Web Services Configuration” was helpful enough for our developers to create several interfaces based on that technology.

    Another way is the SQL way: The table Case_Interface can be used to import cases (we use it for events from Icinga, our monitoring tool), and most likely even for updating them.

    The easiest way, however, is using XML injection via mail. I use it when the other side is rather unknown or hard to customize.
    The description on the F1 helpfile article “Support for HTML tags in Inbound Mail XML” describes the most modern way to do it (just search for “html inbound mail”).
    Hint: If you replace

    <Case id="ProcessInboundXMLTest">

    by

    <Case id="123456">

    while 123456 is the case number, you can even update cases.
    And this HTML injection does not only work for Cases. Theoretically, you can even create and update, Resource Logs, Contracts – whatever you want.
    Downside: You need to find a good way to return the Case ID back – maybe with a POB message event or a program action calling a script when a case arrives.

    If you have more questions, just ask. I’m a bit experienced with POB interfaces. 🙂

    Br,

    Stefan Reichelt, COMPAREX

    #3801
    redberg
    Member

    Thanks!
    Your SQL alternative sounds interesting. Are you executing the SQL queries from the Icinga side directly into POB MSSQL to create/update tickets?

    Can you show me some example SQL queries?

    I do not want to rely on mailservices, so this is no alternative for me.

    #3802
    Stefan Reichelt
    Participant

    Yes, the SysAdmin who is responsible created some scripts, inserting directly into Case_Interface.
    I created some External System Filters in POB, connected them with Data Templates and made sure that only some few fields need to be submitted. The CaseLoad service (AS) is automatically converting them into tickets, returning the Case ID into the Case_Interface table. To you know that feature? F1 help returns some helpful descriptions if you look for “case interface”.
    I recommend (in that order):
    – “Configuring CaseLoad Service
    – “Creating an External System”
    – “Mapping the Case_Interface and the Case Tables”
    – “Setting Up External System Filters”

    Example statement (based on the mapping configured in the External System in POB):

    INSERT INTO Case_Interface (
           external_system_id
           ,sub_system
           ,description --Case Description
           ,external_time_stamp
           ,memo --insert Problem memo text here (HTML, 2000 max. characters)
           ,severity
           ,field_2 --Case Type
           ,field_4 --Case Category
           )
    VALUES (
           N'ICTScript'
           ,N'UserScript'
           ,N'This is the Case Description'
           ,GETDATE()
           ,N'<html><body>Testtext, HTML</body></html>'
           ,0
           ,N'Service Request'
           ,N'CaseCategoryId'
           )
    
    /*See results*/
    SELECT *
    FROM Case_Interface

    The CaseLoad service recognizes the combination of External System (-> column mapping) and Sub System (defined on “External System Filter”, determines the correct Data Template). The service creates the Case, using the Data Template, and it returns the Ticket ID into column case_id.
    If you also fill out the column “external_id” (not included in the script above) with a kind of event GUID, you can use it to find the unique event later again, and identify the Ticket ID created for it. If there is no Ticket ID, you can find the reason in the AS log.

    PS – maybe also interesting: According to the helpfile, there is a “Case Interface Inserter” available (probably only for the ones who ask Wendia about it). It is a .exe file with a little config that can be used to insert lines into the Case_Interface table without direct SQL but simple parameters. But I’m not experienced with it, we write into the table directly.

    PPS: How did you manage to upload your picture here? 😉

    #3803
    redberg
    Member

    Thanks, will dig into it.

    Picture, well. Edit My profile -> Profile Picture -> Created account @ Gravatar using same emailadress, then by magic, it was here. Don’t ask me how it works 🙂

    #3824
    redberg
    Member

    Hi again,
    What software package do you use to connect to POB/MSSQL from Linux? and are you able to email me the script to use as example?

    /Roberth

    #3828
    Stefan Reichelt
    Participant

    Hi,

    what I could find out so far: The guy who created the connection is using freedts and DBI Perl. He said that it took him some time to develop that interface, and he seems to be not happy to share his code. But he’ll write something for me to share with you.
    I’ll get back to you when I have more.

    Br,

    Stefan

    #3829
    Stefan Reichelt
    Participant

    Update – this is his notification config in Icinga:

    object NotificationCommand "mail-host-notification" {
      import "plugin-notification-command"
    
      command = [ SysconfDir + "/icinga2/scripts/notify_host_via_mssql.pl" ]
    
      env = {
        NOTIFICATIONTYPE = "$notification.type$"
        HOSTALIAS = "$host.display_name$"
        HOSTADDRESS = "$address$"
        HOSTSTATE = "$host.state$"
        LONGDATETIME = "$icinga.long_date_time$"
        HOSTOUTPUT = "$host.output$"
        NOTIFICATIONAUTHORNAME = "$notification.author$"
        NOTIFICATIONCOMMENT = "$notification.comment$"
        HOSTDISPLAYNAME = "$host.display_name$"
        USEREMAIL = "$user.email$"
      }
    } 

    Regarding technical details, I can forward you a mail directly – if you tell me your mail address. 🙂

    #3830
    redberg
    Member

    roberth.edberg@atg.se

    I would be greatful if I would receive some tech details, above is my email. I’ve been working with freetds before, but will probably write this using Microsoft’s own sql tools for Linux (https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools).

    If I’m successful, I can share it with you.

    /Roberth

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.