Error Reference

Cross-scope access denied: script cannot access global scope

Cross-scope access denied: script cannot access global scope

Where this appears

This error appears in the Application Log under System Diagnostics > Log > Application Log when a scoped application script attempts to access resources in the global scope or another application scope. The error typically occurs during script execution in Business Rules, Script Includes, UI Actions, or Client Scripts when cross-scope access policies are not properly configured.

Sourdough
Chrome Extension

Debugging this in a real instance?

Sourdough lets you trace "Cross-scope access denied: script cannot access global scope" through system logs, script errors, and API health in the ServiceNow tab you are already using.

Add to Chrome

Free to install. Pro $5/month after a 14-day no-card trial.
Pro requires the ServiceNow admin role. Upgrade inside the extension.

Overview
Tasks
CMDB
API
Metrics
Monitor
Internals
Instance:sourdoughdev·Version:Yokohama
Instance StateONLINE
System StatusFully Operational
Session Timeout90 minutes
Logged-In Sessions2 (20 active)
Build Nameyokohama-12-18-2024_p1
IP Address10.159.128.43
Instance HealthHealth Score: 90%
🔥 5dSourdough (Chrome Plugin)Dark Mode

Cause

The target scope (global or another application) does not have a Cross-scope Access Policy record configured to allow access from the requesting application scope. (high likelihood)

The Cross-scope Access Policy exists but is inactive or has restrictive conditions that prevent access to the specific resource being requested. (high likelihood)

The script is trying to access a table, API, or resource that is explicitly restricted from cross-scope access regardless of policies. (medium likelihood)

The application scope configuration has 'Enforce application scope' enabled but the necessary cross-scope privileges have not been granted through the Application Access tab. (medium likelihood)

The script is running in a different scope context than expected due to impersonation or elevated privileges changing the execution context. (low likelihood)

Fix

Step 1: Navigate to System Definition > Application Cross-Scope Access and identify if a policy exists between your source application scope and the target scope (global or specific application).

Step 2: If no Cross-scope Access Policy exists, create a new record with Source scope set to your application, Target scope set to the destination scope, and Status set to Allowed.

Step 3: If the policy exists but is inactive, verify the Status field is set to Allowed and check any Operation conditions to ensure they match your use case.

Step 4: Navigate to your source application record in System Applications > Applications and review the Application Access tab to ensure proper cross-scope privileges are configured.

Step 5: Test the cross-scope access by running a simple script in Scripts - Background to verify the policy is working before retesting your original functionality.

Step 6: Check System Properties > Security to ensure 'glide.security.ui.allow_global_script' and related cross-scope security properties are not overly restrictive for your use case.

Step 7: If accessing specific tables or APIs, verify in System Definition > Tables that the target table allows cross-scope access and is not restricted by ACLs.

Step 8: Clear the cache and restart any related services or refresh the instance to ensure the new cross-scope policies take effect.

Test Your Knowledge

Quick 3-question quiz. See how your ServiceNow skills stack up.

Question 1 of 3Performance

A list view on a table with millions of records is slow. Best fix?

Select an answer to continue