Stop Change tickets from being created by API if reference values do not exist in ServiceNow

Dineshdmkk18
Tera Contributor

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

2 REPLIES 2

Ryan Duce
Tera Guru

Here's the procedure I would follow.

  1. Create a scoped application for your change request integration, with its own user role.
  2. 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.
  3. Create a transform map in the scope using the import set table as source and change_request as target.
  4. In your reference field mappings, define the "choice action" as "reject". This will prevent invalid references from inserting the entire change record.
  5. 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.
  6. 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!

Dineshdmkk18
Tera Contributor

Thanks @Ryan Duce