- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
Thursday
Hello,
I'm trying to call a script include "GRCAssessmentUtils" (OOTB) from a BR, but I'm receiving this log message:
com.glide.script.RhinoEcmaError: "GRCAssessmentUtils" is not defined.
sys_script.18cab9d7c3bcb210995c98fdd4013165.script : Line(11) column(0)
8: grAssessment.query();
9:
10: if (grAssessment.next()) {
==> 11: new GRCAssessmentUtils().evaluateAssessmentResult(grAssessment);
12: } else {
13: gs.info('Nenhum assessment finalizado encontrado para o controle: ' + current.sys_id);
14: }
Stack trace:
at sys_script.18cab9d7c3bcb210995c98fdd4013165.script:11 (executeRule)
at sys_script.18cab9d7c3bcb210995c98fdd4013165.script:15
at sys_ui_action.55b4f5c7c3b83210995c98fdd4013165.script:2
I tried to create a new and simple script include to test in the backgroud script and receive the same "is not defined." message.
Can anyone help me to execute script includes?
Solved! Go to Solution.
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
Thursday
Hello @pverni,
The error indicates that the Script Include isn’t being recognized in your current scope. Since GRCAssessmentUtils is part of the sn_grc scoped application, you need to reference it using the full scoped name.
Try initializing it like this instead:
new sn_grc.GRCAssessmentUtils().evaluateAssessmentResult(grAssessment);
Also, make sure your Business Rule runs in the same scope or has “Accessible from: All application scopes” set in the Script Include definition.
This should resolve the is not defined error when calling the OOTB Script Include.
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
Thursday
If the Business Rule is not also in the GRC: Profiles scope, use the full API Name in the call
new sn_grc.GRCAssessmentUtils().evaluateAssessmentResult(grAssessment);
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
Thursday - last edited Thursday
that script include extends OOTB Script Include "GRCAssessmentUtilsBase"
you can call the GRCAssessmentUtilsBase script include
also ensure if you are calling that outside of the scope of script include use complete API name
new sn_grc.GRCAssessmentUtils.evaluateAssessmentResult(grAssessment);
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
Thursday
Hello @pverni,
The error indicates that the Script Include isn’t being recognized in your current scope. Since GRCAssessmentUtils is part of the sn_grc scoped application, you need to reference it using the full scoped name.
Try initializing it like this instead:
new sn_grc.GRCAssessmentUtils().evaluateAssessmentResult(grAssessment);
Also, make sure your Business Rule runs in the same scope or has “Accessible from: All application scopes” set in the Script Include definition.
This should resolve the is not defined error when calling the OOTB Script Include.
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
Thursday
Thanks for your help!
It's working!
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
Thursday
If the Business Rule is not also in the GRC: Profiles scope, use the full API Name in the call
new sn_grc.GRCAssessmentUtils().evaluateAssessmentResult(grAssessment);
