Stop Change tickets from being created by API if reference values do not exist in ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 10:48 PM - edited 04-15-2024 10:56 PM
Hello Team,
Third party deployment tool interfaces with ServiceNow using third party deployments. They have replicated the SN change form for people to fill in as part of the deployment pipeline. They currently have free text fields in place of references fields, so we need to stop change tickets from being created if the entries do not exist in the referenced table.
Example:
Change tickets do not create via api when any data pushed into a reference field does not exist
Change tickets do not create via api when any mandatory fields are empty
Please share your suggestions.
Thanks,
DC
- Labels:
-
Architect

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 11:46 PM
Here's the procedure I would follow.
- Create a scoped application for your change request integration, with its own user role.
- Create a new import set table in this scope (extending sys_import_set_row) called something appropriate. Make sure crud operations are restricted to the user role provided in step 1.
- Create a transform map in the scope using the import set table as source and change_request as target.
- In your reference field mappings, define the "choice action" as "reject". This will prevent invalid references from inserting the entire change record.
- Expose the Import Set API on your import set table by creating a service account with the user role you set up in step 1.
- When your API consumers fire change requests into the import set table, they should get error messages pertaining to why records are rejected - i.e. because the reference values could not be looked up in the transform map.
Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 12:35 AM
Thanks @Ryan Duce