Inbound Integration

harry24
Tera Contributor

Hello everyone,

 

I have a requirement where I have done integration with third party using rest message for change table which is working fine .

After build stage the change is created in third party and now when it moves to test , it will perform testing in 3rd party and once done 3rd party will send flag to ServiceNow ,so how we do inbound integration for patch method .

I am unable to understand what will be the triggering point , how will system understand that the flag has been sent from third party and then the workflow should move forward.

 

How do I achieve this using transform maps? 

 

@Community Alums @Ankur Bawiskar Please help .

Can somebody help

5 REPLIES 5

hi @harry24 

To achieve the integration using an import set in ServiceNow for handling flags sent from a third party, follow these steps:

 

Create a new import set table where the third party will send data.

Create a new data source under - System Import Sets > Data Sources.

 

  • Type: REST API (if you expect to receive data via a REST API call).
  • Endpoint: Set the endpoint where the third party will send the data.

Create an import set

 

  • Name: Third Party Change Flags Import
  • Source Table: Select the import set table created earlier.
  • Data Source: Select the data source you created.

Create a new transform map

 

  • Name: Transform Third Party Change Flags
  • Source Table: Your import set table

Map the fields from your import set table to the change request table.

 

If you want to automate the import process, then create scheduled job, here you can refer sample script:

var importSetGR = new GlideRecord('u_third_party_change_flags'); // Your import set table
importSetGR.query();

while (importSetGR.next()) {
    var changeGR = new GlideRecord('change_request');
    if (changeGR.get(importSetGR.change_id)) {
        // Update the state based on the flag
        if (importSetGR.status_flag == 'testing_completed') {
            changeGR.state = 'Test Completed'; // Update as per your state mapping
            changeGR.update();
        }
    }
}