API to get the current applications's scope name inside a script in global processor

jivanjotkaur
ServiceNow Employee
ServiceNow Employee

I am writing a global java processor inside which i need to perform an extra set of processes if the processor is being called from a certain scope. How can i check for the current application scope inside this global processor?

For example, there is a LocalScope api (com.glide.sys.fencing.LocalScope) which when used inside my global processor (LocalScope().get().scope().name()) returns 'global': which is the scope local to the code being executed. Is there any other similar api which can probably check from the current session for the current scope or any system property where the currently active scope is stored?

2 REPLIES 2

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Jivanjot,



var currentScope = gs.getCurrentScopeName();


gs.info(currentScope); //This will give name of current scope.


http://wiki.servicenow.com/index.php?title=Scoped_GlideSystem_API_Reference#getCurrentScopeName.28.2...


Hi Pradeep,



I need to use the api inside the java class for the processor. getCurrentScopeName() is not avaialble for the GlideSystem (com.glide.script.GlideSystem) object used inside the java class.