ServiceNow
Last updated
Last updated
App admin url: https://developer.servicenow.com/dev.do#!/home
Once the app admin account is created and verified you need to create an instance.
It will take a minute or two or three or five to complete.
Now your developer instance is ready and accessible: https://dev180380.service-now.com/. Note that when creating a new account, your instance ID (dev180380
in this case) will be different.
To configure webhooks in ServiceNow to receive notifications when a new record is created, follow these steps. This involves creating an Outbound REST Message, setting up a Business Rule to capture record creation, and configuring the webhook.
Navigate to System Web Services > Outbound > REST Message.
Click on the New button to create a new REST Message.
Fill in the fields such as:
Name: e.g., AppmixerNotifications
.
Click Submit and then open the newly created REST Message.
Click on the HTTP Methods tab and create a new HTTP Method.
Fill in the details such as:
Name: e.g., events
.
HTTP Method: POST.
Endpoint: Ensure this is filled with your webhook listener’s URL.
Optionally, add default HTTP Request Headers (e.g., Content-Type) and customize the Request Body or Query Parameters if needed.
Save the HTTP Method.
Navigate to the table for which you want to capture new record creation. For example, if it’s the Incident table, go to Incident > All.
Right-click on the form header and select Configure > Business Rules.
Alternatively, you can navigate to Activity Subscriptions -> Administration -> Business Rules.
Click on the New button to create a new Business Rule.
Set the fields as follows:
Name: e.g., Incident Rules
.
Table: Select the appropriate table (e.g., Incident
).
When: Insert.
Under Advanced, check the box Advanced to open the script editor.
In the Script section, add the following code:
Note that AppmixerNotifications
should be the same as the name of the Outbound REST Message in the previous step.
The code above handles only new records in the incidents
table. If you want to track new items in other tables, create another business rules and send the notifications to the Appmixer endpoint, where the type
of the event is in format like: '.insert':
Endpoint: https://<YOUR_API_BASE>/plugins/appmixer/servicenow/events
for example https://api.appmixer.com/plugins/appmixer/servicenow/events