feat(trigger): add ServiceNow webhook triggers#4077
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Wires these triggers into the UI and execution path by updating the ServiceNow integration metadata ( Reviewed by Cursor Bugbot for commit 952cc69. Configure here. |
Greptile SummaryThis PR adds 5 ServiceNow webhook triggers ( Confidence Score: 5/5Safe to merge — all prior security concerns are resolved and remaining findings are P2 style improvements. The PR is well-structured, follows established patterns (Salesforce/GitHub triggers), and has addressed the two prior review issues (webhook secret auth + non-TSDoc comment). The two remaining findings are P2: a missing apps/sim/triggers/servicenow/utils.ts (setup instructions example payload), apps/sim/lib/webhooks/providers/servicenow.ts (dynamic import)
|
| Filename | Overview |
|---|---|
| apps/sim/triggers/servicenow/utils.ts | Core utility: setup instructions, output builders, and event-matching logic. Event matching logic is correct and handles all 5 trigger IDs; example payload is missing tableName/eventType fields that the matching logic relies on. |
| apps/sim/lib/webhooks/providers/servicenow.ts | New provider handler with correct auth (Bearer + X-Sim-Webhook-Secret) and event matching via delegated isServiceNowEventMatch. Uses an unnecessary dynamic import for a synchronous utility. |
| apps/sim/blocks/blocks/servicenow.ts | Trigger subBlocks correctly spread from all 5 trigger configs via getTrigger(); trigger IDs and tool access arrays are consistent. |
| apps/sim/triggers/servicenow/incident_created.ts | Primary trigger with includeDropdown: true; structure and ID match registry and block config correctly. |
| apps/sim/triggers/registry.ts | All 5 ServiceNow triggers registered correctly; imports are alphabetically placed in the right section. |
| apps/sim/lib/webhooks/providers/registry.ts | servicenowHandler correctly registered under the 'servicenow' key; no longer falls through to the unauthenticated default handler. |
Reviews (2): Last reviewed commit: "lint" | Re-trigger Greptile
Add webhookSecret field to ServiceNow triggers (matching Salesforce pattern) so users are prompted to protect the webhook endpoint. Update setup instructions to include Authorization header in the Business Rule example. Remove non-TSDoc inline comment in the block config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add dedicated ServiceNow webhook provider handler with: - verifyAuth: validates webhookSecret via Bearer token or X-Sim-Webhook-Secret - matchEvent: filters events by trigger type and table name using isServiceNowEventMatch utility (matching Salesforce/GitHub pattern) The event matcher handles incident created/updated and change request created/updated triggers with table name enforcement and event type normalization. The generic webhook trigger passes through all events but still respects the optional table name filter. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 952cc69. Configure here.
* feat(trigger): add ServiceNow webhook triggers * fix(trigger): add webhook secret field and remove non-TSDoc comment Add webhookSecret field to ServiceNow triggers (matching Salesforce pattern) so users are prompted to protect the webhook endpoint. Update setup instructions to include Authorization header in the Business Rule example. Remove non-TSDoc inline comment in the block config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(trigger): add ServiceNow provider handler with event matching Add dedicated ServiceNow webhook provider handler with: - verifyAuth: validates webhookSecret via Bearer token or X-Sim-Webhook-Secret - matchEvent: filters events by trigger type and table name using isServiceNowEventMatch utility (matching Salesforce/GitHub pattern) The event matcher handles incident created/updated and change request created/updated triggers with table name enforcement and event type normalization. The generic webhook trigger passes through all events but still respects the optional table name filter. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * lint --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

Summary
buildTriggerSubBlockshelper with setup instructions for Business Rules + RESTMessageV2Type of Change
Testing
Tested manually
Checklist