How to fix CrossScopeAccessNotAllowedException for Virtual Agent API?

Lokesh14
Giga Contributor

I am getting 2 responses from Virtual Agent API and I see below error in Logs. I followed all the steps from this page https://docs.servicenow.com/bundle/paris-performance-analytics-and-reporting/page/administer/virtual-agent/concept/virtual-agent-api.html

org.mozilla.javascript.EcmaError: Cannot find function getMessage in object JavaException: com.glide.script.fencing.CrossScopeAccessNotAllowedException: Access to ScriptableRESTResponse.getBody from scope sn_va_as_service not allowed.

Can someone please tell me what I need to do to fix this? I have not added anything additional other than the instructions in the link.

1 ACCEPTED SOLUTION

Ct111
Tera Sage

My inputs on below error

com.glide.script.fencing.CrossScopeAccessNotAllowedException:

You need to create record in cross scope table so that access is allowed . Set the status of the record to allowed 

 

Example for reference :

EXAMPLE1 for reference

 

For information about it read this doc, you can search cross scope in filter navigator

CRoss scope Record

 

 

View solution in original post

7 REPLIES 7

Ct111
Tera Sage

My inputs on below error

com.glide.script.fencing.CrossScopeAccessNotAllowedException:

You need to create record in cross scope table so that access is allowed . Set the status of the record to allowed 

 

Example for reference :

EXAMPLE1 for reference

 

For information about it read this doc, you can search cross scope in filter navigator

CRoss scope Record

 

 

Lokesh14
Giga Contributor

Thank you so much, that seemed to solve that error. However I get the following error when I make a call from the script.

find_real_file.png

Whereas when I make the same call through REST Client it doesn't give me any error and I get a response back on my webhook.

Can you Mark my Answer as CORRECT and Helpful if it helped you in achieving your objective so that it helps anyone who is stuck with same issue

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

please share screenshot of the error

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader