Skip to main content
Skip table of contents

Portal Integration with Servicenow Incidents




While this integration was thoroughly tested as of February 2024, please note that ongoing support may not be guaranteed beyond this point.

Purpose

This document describe how to create incidents through REST API  in ServiceNow from Portal.

Introduction

In this document we explore how to create incidents in ServiceNow using their REST API and a combination of Webhooks and Event Notifications from Portal.

This article will not go into a deep explanation of ServiceNow’s REST API. If you need the full list of endpoints you can check their documentation here.

Open the REST API Explorer in Your Instance

First open the REST API Explorer from your ServiceNow instance.

The Explorer is a tool that help you build your request to the REST API. Once again, this article is focusing solely on creating an incident.


  1. On the left side menu, select the option Create a record (POST) (fig.1).

  2. Select the table type you want to create a record to. (fig.2)
    In this example we selected Incident (incident) in the drop-down menu.

  3. This is the endpoint to which you need to make the request against (fig.3) .
    The variable {tableName} is the one you selected in step 2. In this case, the full URL would be:

    XML
    https://{your-instace-name}.service-now.com/api/now/table/incidents
  4. Scroll down to the Request Body section and click on Add a field.

  5. A new line is displayed with a drop-down menu (fig. 1 and 2) where you can select which fields you want to populate when creating an incident via the integration. In this case we are using a request with a short_description




  6. If you want to add more fields, click on the + button (fig. 3) to add new.

  7. An example of the body is displayed in json format beneath rows (fig. 4).

Next step is to create the integration in the Portal.

Create a Webhook in Portal

To create a webhook integration in Portal:

  1. Navigate to Configuration > Integrations in the left side menu:



  2. Click on the green (plus) button at the bottom right, a new side panel is displayed:




  3. Select Webhook from the drop-down menu and fill in the fields:

    1. Name: the name you want to give to this integration.

    2. URL: the URL from ServiceNow that you just generated in the previous section.

    3. HTTP method: POST

    4. Content sample: this is just to test out the integration. You can copy+paste the body that we just generated in the previous section.

  4. Click on Add, at the right corner to create the integration.

  5. Next is to add authentication.
    Navigate to the Authentication tab and fill in the fields.
    For this example Basic Auth is used:


    Make sure you are using your User ID as the username and not your e-mail or any other identifier. To check this, you can go to your profile in ServiceNow. The user also needs to have the necessary permissions and it cannot have MFA enabled.

  6. Once you are done you can go back to the Settings tab and click on Verify. If the information is correct, a new incident is created with the Short Description “This is a short description“:






  7. Click on Save and continue to the next step.

Create an Event Notification


  1. Navigate to Configuration > Notification Settings in the sidebar:



  2. Once there, click on the green (plus) button at the bottom right, a new side panel is displayed:



    Name
    : Is the name you want to give to this event notification.
    Trigger: In this example we are building an integration that creates a new incident every time a new finding is discovered, so Finding created is used.
    Integration: Select the integration just created in the previous step from the list.
    Content: Provide the short_description named of the finding using the appropriate variable. You can see the list of available variables by clicking on the Available variables card.

    {"short_description":"{{ finding.name }}"}



    HTTP method: POST

  3. Click on Add and you are ready to go!

Now an incident is created every time a new finding is discovered.





Copyright

© 2024 Outpost24® All rights reserved. This document may only be redistributed unedited and unaltered. This document may be cited and referenced only if clearly crediting Outpost24® and this document as the source. Any other reproduction and redistribution in print or electronically is strictly prohibited without explicit permission.

Trademark

Outpost24® and OUTSCAN™ are trademarks of Outpost24® and its affiliated companies. All other brand names, product names or trademarks belong to their respective owners.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.