Easily integrate ServiceNow using SnapLogic

    July, 2017

    IT service management operations are often completely inefficient in a company because of document based data management, manually entering whole or part of the data or some semi-dynamical process flows that needs human to interact with it. Nowadays, companies are investing increasingly into streamlining operations via cloud-based ITSM solutions. This new implementation of cloud based ITSM system can create an even bigger headache if it is not integrated properly with your existing systems and applications. To avoid this, you will probably need an extensible and scalable strategy to avoid losing more time and money and successfully connect all these investments into a complete operating solution, which will help your enterprise to achieve the first goal and have an agile, efficient way to organize and decrease your operational costs.

    If you are looking for integration between ServiceNow and SnapLogic you probably heard about both of them. But here are few words about them:

    SnapLogic as an elastic cloud based integration platform delivers the only Enterprise Integration solution in the market today that is purpose-built for Cloud integrations. More and more companies are demanding the agile IT that SaaS and cloud applications are offering.

    ServiceNow is a software platform that supports IT service management and automates common business processes. This software as a service (SaaS) platform contains a number of modular applications that can vary by instance and user. With it, a user can achieve end‑to‑end transformation for all IT services and infrastructure, through a single cloud‑based platform. ServiceNow IT Service Management (ITSM) software lets you consolidate fragmented tools and legacy systems while automating service management processes.

    Custom integration is a heavy and pretty expensive process that will require custom development, time and money for production deployment and code hosting etc.  Now, we can completely avoid this using SnapLogic platform that features pre-built, intelligent connectors, called Snaps specialized for ServiceNow which are exposing the ServiceNow API visually.

    Picture1: ServiceNow snaps in SnapLogic

    Also, SnapLogic provides a pretty simple way to build, deploy and monitor the code and perform a completely stable production integration.

     

    Use case

    For each of the processes (pipelines) that we are developing, SnapLogic’s best practices and coding standards are followed and error handling, logging and retry logic are implemented. ServiceNow as an application provides the ability for incident creation that will gain an easy tracking of the error that occurred, time spent for the incident to be resolved, team that worked on that specific incident and etc.

    In this specific scenario, we will explain how to create an incident ticket with specific category, assignment group, description and type. Hence, we will add an attachment file to the ticket, which contains all the errors that happened in one particular flow.

    To keep this simple and easy understanding we will minimize the use of snaps. At start, we will create an incident ticket in ServiceNow for a specific error that may occur.

    Snaps used for this scenario:

    • Mapper
    • ServiceNow Insert

    Picture2: Pipeline for creating ServiceNow incident ticket

    In order to successfully create the incident ticket, we will send the following parameters to ServiceNow:

    Picture3: Mapper snap where fields from the incident table of ServiceNow ticket are mapped

    As you can see on the right side of the mapper there is a schema exposed from the ServiceNow API incident table.

    Picture4: ServiceNow Insert snap with incident table used

    Please note that these are not required fields for successful creation of the incident ticket, but we chose them so we can show the benefits of having ServiceNow better and how easy the integration is going between it and SnapLogic, even though there are many fields to be populated.

    As we send this request, with these specific parameters, we will create a ServiceNow ticket which can be previewed in the UI of ServiceNow:

    Picture5: ServiceNow UI incident ticket preview

     

    After a successful creation of the ServiceNow ticket with certain type, category and descriptions, we can go a step further and upgrade this already existing ticket. For that purpose, we will need few more snaps, to add the attachment file mentioned previously.

    Why is this important?

    In many occasions, the business wants to take a closer look into the error cause. For that purpose the file that has been subject of processing, to be to the ServiceNow ticket, with the proper error description for the records that are not valid. With this approach the business can easily repair the invalid records and once again send the file for further processing where we can successfully insert it into target system.

    Snaps used for this scenario:

    • File Reader
    • Binary to Document
    • Join
    • Mapper
    • ServiceNow Insert

    Picture6: Upgraded pipeline for adding attachment to an existing ticket in ServiceNow

    Namely, let’s assume that the file sent from the user was invalid and error file was created by the business needs in Snaplogic.

    First, we will read the error file.

    Picture7: File reader snap preview where we are reading an error file

    Because the output of the file reader is in binary format, we will use Binary to Document snap for transforming the binary data in JSON format.

    We will use Join snap to collect the content of the file with its parameters and the ServiceNow create snap output which is returning back info about the ticket that we previously created.

    Once we have all the values that we need, we will use a mapper for sending transformed insert request to ServiceNow. Once this mapper is connected with ServiceNow Insert snap we must choose the suitable table for this operation into the ServiceNow snap. For this purpose, we are going to use the ecc_queue table from ServiceNow.

    Picture8: ServiceNow Insert snap with ecc_queue table used

    In order to make this request successful, there are required fields that should be mapped in it.

    At first, we should map the $source field which must contain a “:” delimited value of the target table and its sys_id. Example: incident:dd90c5d70a0a0b39000aac5aee704ae8. In our case we have the sys id from the ServiceNow create snap response and we are concatenating with the “incident:” string. In the $payload field from ServiceNow we are mapping the content that we got once we read the file. Another field that is necessary, for this attachment to be added successfully, is the $topic which needs to have the following value: “AttachmentCreator” so it can successfully trigger the attachment creation.

    Picture9: Mapper snap where fields from the ecc_queue table of ServiceNow ticket are mapped

    Finally, we have a ServiceNow ticket updated with attached error file:

    Picture10: ServiceNow UI incident ticket with attachment preview

    In the following screenshot we can see the error description, and the reasons of failing behind every record:

    Picture11: Error file preview

    Conclusion:

    From this particular use case we can see that SnapLogic makes the integration process of ServiceNow fairly easy without any manual efforts or complex traditional integration processes. There is one quote being said: “More can be done in two hours with SnapLogic than two days with traditional solution.”

    Metodija Jadroski,

    Technical Consultant