This guide sets up a ServiceNow endpoint that receives Forager attestations and updates the matching CI record in real time. Choose this approach if your team wants immediate CI visibility and full control over which fields get updated.Documentation Index
Fetch the complete documentation index at: https://docs.hiveriselabs.com/llms.txt
Use this file to discover all available pages before exploring further.
If your organization requires change-controlled or staged CMDB writes, see ServiceNow — Import Sets instead.
What happens
ServiceNow setup
Step 1 — Create a dedicated integration user
- Go to User Administration → Users → New
- Set:
- User ID:
forager_integration - Web service access only: ✅
- User ID:
- Set a strong password and save it — you’ll enter it in Forager
- On the Roles tab, add:
rest_service— allows REST API authenticationitil— allows creating and updating CI records
Step 2 — Create the Scripted REST API
- Go to System Web Services → Scripted REST APIs → New
- Set Name:
Forager Asset Location, API ID:forager_asset_location - Save
Step 3 — Add a Resource
- In the Resources tab, click New
- Set Name:
Receive Attestation, HTTP method:POST, Relative path:/attestation - Paste this script:
- Save the resource
Step 4 — Add custom fields to cmdb_ci
The script writes to five custom fields. Create them oncmdb_ci (or a specific subclass):
- Open any CI record → right-click a column header → Configure → Table
- Open Columns and add:
| Column label | Column name | Type | Max length |
|---|---|---|---|
| Forager Location | u_forager_location | String | 500 |
| Forager Anchor | u_forager_anchor | String | 200 |
| Forager Confirmed At | u_forager_confirmed_at | String | 50 |
| Forager Confirmed By | u_forager_confirmed_by | String | 200 |
| Forager Event Type | u_forager_event_type | String | 50 |
These are string fields rather than the native ServiceNow
location reference field. The native field requires a sys_id from the cmn_location table. Forager sends a human-readable breadcrumb (Building A / Floor 2 / IT Office), which maps cleanly to a string field. A Transform Map can bridge these if needed later.Step 5 — Get your endpoint URL
Your endpoint URL follows this pattern:Forager dashboard setup
- Go to Settings → CMDB Webhooks → Add webhook
- Fill in:
| Field | Value |
|---|---|
| Name | ServiceNow Production |
| Endpoint URL | Your URL from Step 5 |
| Auth Header Name | Authorization |
| Auth Header Value | Basic [base64(username:password)] |
Generating the Basic Auth value
Basic : Basic Zm9yYWdlcl9pbnRlZ3JhdGlvbjpZb3VyUGFzc3dvcmQ=
Testing
u_forager_* fields were updated.
Troubleshooting
| Response | Cause | Fix |
|---|---|---|
401 Unauthorized | Wrong credentials | Re-generate the Base64 string; check for trailing spaces |
403 Forbidden | Missing role | Add itil role to the integration user |
404 Not Found | CI not found by asset tag | Verify asset tag matches exactly in ServiceNow; check the asset_tag field vs name field |
500 | Script error | Check System Logs → REST API Activity in ServiceNow for the stack trace |