Cross scope Access best practice

UjwalaBedarkar
Tera Expert

Hi All,

 

I want to update the install group from the 'sn_ms_intune_spoke_sf_config' table to a custom field on the software model table which is in global scope.

I have create below business rule: 

Screenshot 2026-05-06 210935.png

BR code:

var IntuneToSAMUtils = Class.create();

IntuneToSAMUtils.prototype = {
 
    initialize: function() {},
 
    updateProductModelSupportLink: function(intuneAppSysId, installGroup) {
 
        if (!intuneAppSysId || !installGroup) {

            return;

        }
 
        var samModel = '';
 
        // Get model from Intune application

        var grApp = new GlideRecord('sn_ms_intune_spoke_application');

        if (grApp.get(intuneAppSysId)) {

            samModel = grApp.model;

        }
 
        if (!samModel) {

            return;

        }
 
        // Update Software Product Model

        var grModel = new GlideRecord('cmdb_software_product_model');

        if (grModel.get(samModel)) {
 
            // Avoid unnecessary update

            if (grModel.u_product_support_link != installGroup) {

                grModel.u_product_support_link = installGroup;

                grModel.setWorkflow(false);

                grModel.update();

            }

        }

    },
 
    type: 'IntuneToSAMUtils'

};
 

 

which call the script include from global scope

Script include:

 

(function executeRule(current, previous /*null when async*/ ) {
 
    // Add your code here
 
    var grpValue = current.install_group;
    if (!grpValue) {
        return;
    }
 
    var appl = current.application;
    var samModel;
 
    var grApp = new GlideRecord('sn_ms_intune_spoke_application');
    grApp.addQuery('sys_id', appl);
    grApp.query();
    if (grApp.next()) {
        samModel = grApp.model;
    }
 
 
    var grConfig = new GlideRecord('cmdb_software_product_model');
    grConfig.addQuery('sys_id',samModel);
    grConfig.query();
    if(grConfig.next()){
        grConfig.u_product_support_link = grpValue;
        grConfig.update();
    }
 
})(current, previous);
 

also added the cross access privilage record as below:

 

Screenshot 2026-05-06 211358.png

Just wanted to check if that a correct approach

1 ACCEPTED SOLUTION

Tanushree Maiti
Giga Patron

Hi @UjwalaBedarkar 

 

You are on correct path .

Just ensure

  • Navigate to the 'sn_ms_intune_spoke_sf_config' table definition.
  • Under Application Access, ensure "Allow access to this table via web services and script include" is checked.

TanushreeMaiti_0-1778083134344.png

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

View solution in original post

3 REPLIES 3

Tanushree Maiti
Giga Patron

Hi @UjwalaBedarkar 

 

You are on correct path .

Just ensure

  • Navigate to the 'sn_ms_intune_spoke_sf_config' table definition.
  • Under Application Access, ensure "Allow access to this table via web services and script include" is checked.

TanushreeMaiti_0-1778083134344.png

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

UjwalaBedarkar
Tera Expert

hi @Tanushree Maiti , 

 

Thanks for response but someone said its not the good approach to use BR in this case and use Service Graph connector or ETL do you have any insights?

Hi @UjwalaBedarkar ,

 

Use the Service Graph Connector for Microsoft Intune to pull data from the Microsoft Intune application into your ServiceNow instance ( Refer: Service Graph Connector for Microsoft Intune ). In my project also , we are using Service Graph connector for pulling data from Intune.  I've missed to convey that to you.

 

Service Graph Connector for Microsoft Intune - Add a custom field

 

The Service Graph Connector (SGC) is preferred over manual scripting because it uses Robust Import Set Transformers (RTE), which allow you to add custom fields to existing entities without breaking the default mappings.

  • SGC utilizes the Identification and Reconciliation Engine (IRE) to determine if a software model already exists, preventing duplicates, rather than blindly importing
  • SGC uses Robust Import Set Transformers, which map complex data structures to the CI-Software Relationship tables
  • SGC is designed for high-volume data importing

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: