<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Call Client callable script include at BR in Champions Community forum</title>
    <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246706#M457</link>
    <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/21188"&gt;@Lucky1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;update as this and it should work from both the side i.e. client and server (BR)&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;getImpact: function(impact, urgency, id) {

        var impact = JSUtil.nil(impact) ? this.getParameter('sysparm_impact') : impact;
        var urgency = JSUtil.nil(urgency) ? this.getParameter('sysparm_urgency') : urgency;
        var id = JSUtil.nil(id) ? this.getParameter('sysparm_id') : id;
        var gr = new GlideRecord('incident');
        gr.addQuery('sys_id', id);
        gr.query();
        if (gr.next()) {
            if (urgency == 1 &amp;amp;&amp;amp; impact == 1) {
                return 1;
            } else if {
                urgency == 1 &amp;amp;&amp;amp; impact == 2) {
                return 2;
            }
        }
    },&lt;/LI-CODE&gt;
&lt;P&gt;Now you can call it like this from server side&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var priority = current.priority;
var urgency = current.urgency;
var impact = current.impact;
if(urgency == 1 &amp;amp;&amp;amp; impact == 1){
current.setValue('priority', 1);
}
var id = current.sys_id;
var val = new ScriptIncludeName().getImpact(impact, urgency, id);&lt;/LI-CODE&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Apr 2025 13:09:28 GMT</pubDate>
    <dc:creator>Ankur Bawiskar</dc:creator>
    <dc:date>2025-04-24T13:09:28Z</dc:date>
    <item>
      <title>Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246577#M449</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a Script Include and written two functions in it.&lt;/P&gt;&lt;P&gt;one for when Impact on Incident changes, and the other one is when urgency changes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I have created two on Change client scripts and calling the corresponding functions in it using Glide Ajax.&lt;/P&gt;&lt;P&gt;So, now whenever we change the Impact or Urgency, on the form, I am setting up the Priority using these two On Change client scripts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, if the Incident is created from Portal side, and if the Impact is 1 and Urgency is 1, then I need to set the Priority to 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, how can I call these two functions in the BR script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lucky&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 11:41:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246577#M449</guid>
      <dc:creator>Lucky1</dc:creator>
      <dc:date>2025-04-24T11:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246588#M450</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/21188"&gt;@Lucky1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Follow the below community post with similar requirement.&lt;BR /&gt;&lt;A href="https://www.servicenow.com/community/itsm-forum/call-client-callable-script-include-from-business-rule/td-p/568633/page/2" target="_blank"&gt;https://www.servicenow.com/community/itsm-forum/call-client-callable-script-include-from-business-rule/td-p/568633/page/2&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Siva&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 11:47:01 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246588#M450</guid>
      <dc:creator>J Siva</dc:creator>
      <dc:date>2025-04-24T11:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246612#M451</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/21188"&gt;@Lucky1&lt;/a&gt;&amp;nbsp;as the link shared by&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/662411"&gt;@J Siva&lt;/a&gt;&amp;nbsp;will solve your query, however, you need to modify your function in the script include. &lt;BR /&gt;&lt;BR /&gt;But I would suggest you to create data lookup rules in your instance to handle these cases, You can define the matrix like on what conditions you want the values to to be set to the Priority field. And with that it should automatically make the changes and this should work from any where.&amp;nbsp; And this can be done just with the configurations.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.servicenow.com/docs/bundle/yokohama-platform-administration/page/administer/field-administration/reference/r_CreateCustomDataLookups.html" target="_blank"&gt;https://www.servicenow.com/docs/bundle/yokohama-platform-administration/page/administer/field-administration/reference/r_CreateCustomDataLookups.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.servicenow.com/docs/bundle/yokohama-platform-administration/page/administer/task-table/concept/c_DataLookupRules.html" target="_blank"&gt;https://www.servicenow.com/docs/bundle/yokohama-platform-administration/page/administer/task-table/concept/c_DataLookupRules.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.servicenow.com/docs/bundle/yokohama-platform-administration/page/administer/field-administration/concept/c_DataLookRecMatchSupport.html" target="_blank"&gt;https://www.servicenow.com/docs/bundle/yokohama-platform-administration/page/administer/field-administration/concept/c_DataLookRecMatchSupport.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Above links will help you understand more about data lookup rules and how to create them.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 12:00:16 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246612#M451</guid>
      <dc:creator>Mohit Kaushik</dc:creator>
      <dc:date>2025-04-24T12:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246651#M452</link>
      <description>&lt;P&gt;Hello SIva,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My script include name is: Inc_scripts&amp;nbsp; &amp;nbsp; (this is Client callable)&lt;/P&gt;&lt;P&gt;functions inside it are:&lt;/P&gt;&lt;P&gt;1. getImpact:function( ){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. getUrgency:function( ){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now can you please tell me how to call these two functions in my BR.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lucky&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 12:30:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246651#M452</guid>
      <dc:creator>Lucky1</dc:creator>
      <dc:date>2025-04-24T12:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246653#M453</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/21188"&gt;@Lucky1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can use same function of that client callable script include and make it call from client side GlideAjax and also from any server side.&lt;/P&gt;
&lt;P&gt;the way how parameters are passed &amp;amp; accessed will vary and need to be tweaked.&lt;/P&gt;
&lt;P&gt;this syntax should help you&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;   getIncidents: function(problemId) {
        var probSysId = JSUtil.nil(problemId) ? this.getParameter('sysparm_sys_id') : problemId;
		// now the probSysId can contain value either coming from ajax or from any server side code
			
    },&lt;/LI-CODE&gt;
&lt;P&gt;&lt;A href="https://www.servicenow.com/community/developer-advocate-blog/client-callable-and-server-callable-script-includes-in-one/ba-p/2977916" target="_blank" rel="noopener"&gt;Client Callable and Server Callable Script Includes (in one!)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 12:30:40 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246653#M453</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-04-24T12:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246659#M454</link>
      <description>&lt;P&gt;Hello ANkur,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Already, the both functions are called in On change CS, using GLide AJax and they are working fine at Clien side,&lt;/P&gt;&lt;P&gt;Now I want to make use of two functions a Business rule.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My script include name is: Inc_scripts&amp;nbsp; &amp;nbsp; (this is Client callable)&lt;/P&gt;&lt;P&gt;functions inside it are:&lt;/P&gt;&lt;P&gt;1. getImpact:function( ){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. getUrgency:function( ){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lucky&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 12:34:08 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246659#M454</guid>
      <dc:creator>Lucky1</dc:creator>
      <dc:date>2025-04-24T12:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246668#M455</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/21188"&gt;@Lucky1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;syntax to call from server side is this i.e. from Business rule&lt;/P&gt;
&lt;P&gt;new scriptIncludeName().getImpact(sendValueHere);&lt;/P&gt;
&lt;P&gt;new scriptIncludeName().getUrgency(sendValueHere);&lt;/P&gt;
&lt;P&gt;But the functions need to be enhanced in script include as well so that it works from both side client and server&lt;/P&gt;
&lt;P&gt;So you will have to update like this in script include&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt; getImpact: function(impact) {
        var impact = JSUtil.nil(impact) ? this.getParameter('sysparm_impact') : impact;
        // now the probSysId can contain value either coming from ajax or from any server side code

    },

    getUrgency: function(urgency) {
        var impact = JSUtil.nil(urgency) ? this.getParameter('sysparm_urgency') : urgency;
        // now the probSysId can contain value either coming from ajax or from any server side code

    },&lt;/LI-CODE&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 12:46:48 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246668#M455</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-04-24T12:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246699#M456</link>
      <description>&lt;P&gt;Hi ANkur,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a bit confusing for me.&lt;/P&gt;&lt;P&gt;Can you please correct my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Script Include:&lt;/P&gt;&lt;P&gt;Name: Inc_scripts&lt;/P&gt;&lt;P&gt;Client callable : true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Script:&lt;/P&gt;&lt;P&gt;getImpact:function( ){&lt;/P&gt;&lt;P&gt;var impact = this.getParameter('sysparm_impact');&lt;/P&gt;&lt;P&gt;var urgency = this.getParameter('sysparm_urgency');&lt;/P&gt;&lt;P&gt;var id = this.getParameter('sysparm_id');&amp;nbsp; //here I am getting the Inc sys_id&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var gr = new GlideRecord('incident');&lt;/P&gt;&lt;P&gt;gr.addQuery('sys_id', id);&lt;/P&gt;&lt;P&gt;gr.query();&lt;/P&gt;&lt;P&gt;if(gr.next()){&lt;/P&gt;&lt;P&gt;if(urgency == 1 &amp;amp;&amp;amp; impact == 1){&lt;/P&gt;&lt;P&gt;return 1;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else if{urgency == 1 &amp;amp;&amp;amp; impact == 2){&lt;/P&gt;&lt;P&gt;return 2;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}.&lt;/P&gt;&lt;P&gt;////////////////////////////////////////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;My Business Rule:&lt;/P&gt;&lt;P&gt;Name: Set Priority&lt;/P&gt;&lt;P&gt;Before update&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Script:&lt;/P&gt;&lt;P&gt;var priority = current.priority;&lt;/P&gt;&lt;P&gt;var urgency = current.urgency;&lt;/P&gt;&lt;P&gt;var impact = current.impact;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(urgency == 1 &amp;amp;&amp;amp; impact == 1){&lt;/P&gt;&lt;P&gt;current.setValue('priority', 1);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;........................................................... and so on&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At on Change client script, I am getting the answer and setting the value to priority.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lucky&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 13:05:18 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246699#M456</guid>
      <dc:creator>Lucky1</dc:creator>
      <dc:date>2025-04-24T13:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246706#M457</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/21188"&gt;@Lucky1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;update as this and it should work from both the side i.e. client and server (BR)&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;getImpact: function(impact, urgency, id) {

        var impact = JSUtil.nil(impact) ? this.getParameter('sysparm_impact') : impact;
        var urgency = JSUtil.nil(urgency) ? this.getParameter('sysparm_urgency') : urgency;
        var id = JSUtil.nil(id) ? this.getParameter('sysparm_id') : id;
        var gr = new GlideRecord('incident');
        gr.addQuery('sys_id', id);
        gr.query();
        if (gr.next()) {
            if (urgency == 1 &amp;amp;&amp;amp; impact == 1) {
                return 1;
            } else if {
                urgency == 1 &amp;amp;&amp;amp; impact == 2) {
                return 2;
            }
        }
    },&lt;/LI-CODE&gt;
&lt;P&gt;Now you can call it like this from server side&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var priority = current.priority;
var urgency = current.urgency;
var impact = current.impact;
if(urgency == 1 &amp;amp;&amp;amp; impact == 1){
current.setValue('priority', 1);
}
var id = current.sys_id;
var val = new ScriptIncludeName().getImpact(impact, urgency, id);&lt;/LI-CODE&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 13:09:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246706#M457</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-04-24T13:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246761#M458</link>
      <description>&lt;P&gt;Hello Ankur,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is not working in BR.&lt;/P&gt;&lt;P&gt;I submitted a record producer which creates Incident. So, while submitting I have given Impact as 1 and Urgency as 1, so the Priority has to be set as 1 but it set as 4, (so not working).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me in correct my code:&lt;/P&gt;&lt;P&gt;My Script Include:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lucky1_0-1745501779259.png" style="width: 656px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/437623iFEF58650E8EFE389/image-dimensions/656x402?v=v2" width="656" height="402" role="button" title="Lucky1_0-1745501779259.png" alt="Lucky1_0-1745501779259.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lucky1_1-1745501819545.png" style="width: 673px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/437624i2A99B9DDB2BC98C4/image-dimensions/673x360?v=v2" width="673" height="360" role="button" title="Lucky1_1-1745501819545.png" alt="Lucky1_1-1745501819545.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;////////////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;My Business RUle:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lucky1_2-1745501872513.png" style="width: 663px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/437625iF81960B6FFF75027/image-dimensions/663x309?v=v2" width="663" height="309" role="button" title="Lucky1_2-1745501872513.png" alt="Lucky1_2-1745501872513.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lucky&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 13:38:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246761#M458</guid>
      <dc:creator>Lucky1</dc:creator>
      <dc:date>2025-04-24T13:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246788#M459</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/21188"&gt;@Lucky1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you didn't share what debugging did you perform?&lt;/P&gt;
&lt;P&gt;I answered your question on how to make sure same function can be called from client side i.e. Ajax and also from server side&lt;/P&gt;
&lt;P&gt;Next part you can debug by adding gs.info() statements&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 13:54:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246788#M459</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-04-24T13:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246805#M460</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/21188"&gt;@Lucky1&lt;/a&gt;- Try following... without "global".&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;new Incident_scripts().getImpact(impact,urgency,current.sys_id);
new Incident_scripts().getUrgency(impact,urgency,current.sys_id);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Let me know if that helped!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Vikas K&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 14:13:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246805#M460</guid>
      <dc:creator>VikMach</dc:creator>
      <dc:date>2025-04-24T14:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246819#M461</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/21188"&gt;@Lucky1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;Script include function:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;getImpact: function(impact, urgency, id) {
    var impact = this.getParameter('sysparm_impact') || impact;
    var urgency = this.getParameter('sysparm_urgency') || urgency;
    var id = this.getParameter('sysparm_id') || id;
    var gr = new GlideRecord('incident');
    gr.addQuery('sys_id', id);
    gr.query();
    if (gr.next()) {
        if (urgency == 1 &amp;amp;&amp;amp; impact == 1) {
            return 1;
        } else if {
            urgency == 1 &amp;amp;&amp;amp; impact == 2) {
            return 2;
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Business Rule script:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var urgency = current.urgency;
var impact = current.impact;
var id = current.id;
var impactNew = new Incident_scripts().getImpact(urgency, impact, id); &lt;/LI-CODE&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"If you found my answer helpful, &lt;STRONG&gt;please like and mark it as an "accepted solution".&lt;/STRONG&gt; It helps future readers to locate the solution easily and supports the community!"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You&lt;BR /&gt;Juhi Poddar&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 14:22:53 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246819#M461</guid>
      <dc:creator>Juhi Poddar</dc:creator>
      <dc:date>2025-04-24T14:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246856#M462</link>
      <description>&lt;P&gt;Hello Ankur,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lucky1_0-1745506284669.png" style="width: 600px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/437645iE78F5F8CB16656BD/image-dimensions/600x300?v=v2" width="600" height="300" role="button" title="Lucky1_0-1745506284669.png" alt="Lucky1_0-1745506284669.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first log is coming up but the second log is not coming&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lucky&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 15:02:13 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246856#M462</guid>
      <dc:creator>Lucky1</dc:creator>
      <dc:date>2025-04-24T15:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246861#M463</link>
      <description>&lt;P&gt;Hello Juhi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please tell me what that last line of code does?&lt;/P&gt;&lt;P&gt;Why we are taking that script include returned value to a variable "impactNew" ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, please note that, I need to call two functions in that script include but not only one.&lt;/P&gt;&lt;P&gt;So, can I call the second one similar to first one as you shown?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lucky&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 14:54:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246861#M463</guid>
      <dc:creator>Lucky1</dc:creator>
      <dc:date>2025-04-24T14:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246957#M464</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/21188"&gt;@Lucky1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In that case it means you are unable to call it&lt;/P&gt;
&lt;P&gt;I will suggest you to check the script include is in which scope and check by adding logs in the script include function&lt;/P&gt;
&lt;P&gt;There are numerous blogs and articles on how to effectively debug your scripts.&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 16:08:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3246957#M464</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-04-24T16:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3247355#M466</link>
      <description>&lt;P&gt;Hello Ankur,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will check it and come back. Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lucky&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2025 03:25:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3247355#M466</guid>
      <dc:creator>Lucky1</dc:creator>
      <dc:date>2025-04-25T03:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3247356#M467</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/21188"&gt;@Lucky1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe I have answered your original question on how to make sure same function can be called from client side i.e. Ajax and also from server side&lt;/P&gt;
&lt;P&gt;Next part you can debug by adding gs.info() statements&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2025 03:27:42 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3247356#M467</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-04-25T03:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Call Client callable script include at BR</title>
      <link>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3247363#M468</link>
      <description>&lt;P&gt;Yes Ankur,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's worked.&lt;/P&gt;&lt;P&gt;Thanks for your time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lucky&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2025 07:23:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/champions-community-forum/call-client-callable-script-include-at-br/m-p/3247363#M468</guid>
      <dc:creator>Lucky1</dc:creator>
      <dc:date>2025-04-25T07:23:32Z</dc:date>
    </item>
  </channel>
</rss>

