Real-Time Data Enrichment for Tickets via External API Call - Feasibility Check
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2025 03:19 AM
Hello, ServiceNow Community!
I'm currently designing a new feature for our instance and would love to get your expert opinion on its feasibility and the best implementation practices.
The Goal: We want to enrich ticket data in real-time by integrating with an external data processing service. The core idea is that every time a ticket is updated with new information, we need to send some of its data to a third-party API, get a result back, and display that result directly on the ticket form.
Proposed High-Level Implementation:
Add Custom Fields: My plan is to add a couple of new fields to the base task table so they are available on incidents, catalog tasks, etc. These would be something like:
A field to store the analysis result returned by the external service.
A second field to display a status or trend based on that result.
Trigger API Calls on Updates: Whenever a ticket is updated (specifically, when a new customer comment or internal work note is added), we need to trigger an outbound REST API call. This call would securely send the relevant ticket data to our external service for processing.
Update the Ticket with the Response: After the external service processes the data, it will return a result. We then need to capture this response and use it to populate the custom fields on the source ticket. This entire process should happen in near real-time without negatively impacting the user experience or platform performance.
My Key Questions:
Triggering Mechanism: What is the most robust and efficient method to trigger an external API call when a record is updated? My initial thought is to use a Business Rule. Would an async rule be the best practice here to avoid delaying the user's transaction?
Technical Implementation: How would you recommend scripting this? Should the Business Rule trigger an event, which is then processed by a Script Action that makes the REST call? Or is there a more direct approach?
Overall Feasibility: From your experience, does this general architecture seem sound and maintainable? Are there any potential pitfalls or major considerations (e.g., managing API timeouts, handling errors, performance at scale) that I might be overlooking?
Alternative Approaches: Are there any alternative, perhaps more "native," functionalities within ServiceNow (like IntegrationHub) that would be better suited for this kind of real-time, event-driven integration?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2025 10:36 PM
To briefly summarize, your proposed approach of using custom fields and triggering real-time external API calls on ticket updates is sound. The most robust and efficient way to trigger these calls without impacting user experience is an Asynchronous Business Rule. This rule should directly call a Script Include that encapsulates the sn_ws.RESTMessageV2 logic for sending data, handling the response, and updating the ticket. This direct Script Include approach is generally preferred over events and script actions for its simplicity and maintainability, ensuring robust error handling and considering potential API timeouts and rate limits for scalability.