Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

"is not in current application scope"

mlopezrivera
Tera Expert

In the script below, I'm trying to call GlideImportSetTransformMap API to create a map between a scoped table and the scoped Security Incident table. However I receive the following error when testing the function in a background script: 

Script execution error: Script Identifier: null.null.script, Error Description: com.glide.script.fencing.CrossScopeAccessNotAllowedException: sn_si_incident is not in current application scope, Script ES Level: 200
var mapName = 'test map';
var myTable = 'test_staging_table';
var targetTable = 'sn_si_incident';
var gistm = new sn_impex.GlideImportSetTransformMap(mapName, myTable, targetTable);

 I have created 3 cross scope privilege records between my app and the Security Incident Response scope for read, write, and create privileges on the sn_si_incident table - but still no luck. Any thoughts?

3 REPLIES 3

Bert_c1
Kilo Patron

What is the value of the 'in scope' field on the Scripts - Background page. Default is Global.

The background script is running in my custom app scope.

The functions that will serve as a wrapper to the GlideImportSetTransformMap will end up being in my app's scope.