Webhook Question - ServiceNow to External 3rd Party
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2023 12:04 PM
Background: We have a company that uses their custom built tool to track incidents , they do not have an open API that we can use to push incidents from our snow instance.
Main Question: Is there a way we can create a webhook for them that they can subscribe so whenever an incident is created in our snow instance they can pull the incident details from our instance.
Thank you in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2023 03:56 AM
Hi @Neel Patel ,
Please refer below article to simulate Webhook behavior in ServiceNow
https://www.transposit.com/devops-blog/itsm/creating-webhooks-in-servicenow/
Please mark response as helpful and correct if it resolves the issue
Regards,
Manmohan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2023 04:42 AM
Hi @Neel Patel ,
Yes, it is possible to create a webhook in ServiceNow that allows an external 3rd party system to receive incident details whenever a new incident is created in your ServiceNow instance. Here's a general approach you can follow:
Determine the endpoint: Work with the 3rd party company to determine the endpoint (URL) where they want to receive the webhook notifications. They should provide you with the necessary details, such as the URL and any authentication requirements (e.g., API keys, tokens).
Create a Business Rule: In ServiceNow, you can use a Business Rule to trigger the webhook whenever a new incident is created. Business Rules are server-side scripts that execute when specific conditions are met. Write a Business Rule that runs when a new incident record is inserted and includes the logic to send the webhook notification.
Construct the webhook payload: In the Business Rule, construct the payload that includes the incident details you want to send to the 3rd party system. This can be done by creating a JSON object that includes relevant fields from the incident record, such as incident number, description, priority, etc.
Send the webhook notification: Use ServiceNow's outbound REST capabilities to send the webhook notification. You can use the 'RESTMessageV2' API to configure the REST message and set the necessary headers, URL, and payload. Send a POST request to the 3rd party system's endpoint, passing the constructed payload as the request body.
Handle response (optional): If the 3rd party system sends a response to the webhook notification, you can handle it in the Business Rule based on your requirements. This can include logging the response, updating the incident record, or performing any necessary actions.
Testing and validation: Thoroughly test the webhook integration to ensure it works as expected. Create test incidents in your ServiceNow instance and verify that the webhook notifications are received by the 3rd party system correctly. Validate the incident details in their system to ensure accurate data transfer.
Thanks,
Ratnakar