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.

Cross scope privilege question

Ram117
Kilo Sage

Experts,

I have a schedule import set job which is scheduled to run on a daily basis. I need to link another 'onDemand' script once this job finishes. The sysauto_Script record resides in a different scope.

On the post import script, I had added a few lines of code to query the sysauto_script and do  a gs.executeNow() .Since this is cross scope , I am getting the access restricted error.

find_real_file.png

The post import script would look as below,

var gr = new GlideRecord('sysauto_script');
if(gr.get('cab39bf71ba0d510ad75a604604bcbae')){
 gs.executeNow(gr);
}

 

I have tried adding a few cross scope privilege record to the other scope from this source scope .  Any guidance on the exact scope privilege record.

thx

ram.

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

what record did you add in cross scope privelege table?

Regards
Ankur

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

hey Ankur,

Added a record from source to global  with targetName as Glide API: scheduled jobs

Added a record from source to global with targetName as Glide API: scripting

Not sure what cross scope record needs to be added to the target scope to get the gs.executeNow working.