How to pass parameters to this script include from Business Rule

Yogesh Kale
Mega Contributor

How to pass parameters to this script include from Business Rule and also how to get response?

 

7 REPLIES 7

Ruhi Jibhyenka1
Mega Guru

Hi Yogesh,

Check out below links-

https://community.servicenow.com/community?id=community_question&sys_id=a600c321db98dbc01dcaf3231f961905

https://community.servicenow.com/community?id=community_question&sys_id=e15f51d91b2800d4d01143f6fe4bcb3f

https://community.servicenow.com/community?id=community_question&sys_id=352a95bd1b1cd010a59033f2cd4bcba0

Mark correct if my answer has solved your issue and or helpful if my response is worthy.

Thanks,

Ruhi.

Akshata jamdar
Mega Guru

Hello yogesh,

 

Please refer below link,

https://community.servicenow.com/community?id=community_question&sys_id=99038ba1dbd8dbc01dcaf3231f96...

 

https://community.servicenow.com/community?id=community_question&sys_id=352a95bd1b1cd010a59033f2cd4b...

 

Hope this will help you.

Kindly mark an answer as correct and helpful if it will resolve your query.

Regards,

Akshata

 

 

reshmapatil
Tera Guru

Hi Yougesh,

Use by this way:

 

Business Rule:

var testSI = new testScriptInclude();

var returnVal = testSI.testFunction(param1, param2,.......);

 

Script Include (Name: testScriptInclude)

var testScriptInclude = Class.create();

testScriptInclude.prototype = {

        initialize: function() {

        },

testFunction: function(param1, param2,.......) {

 

},

type: 'testScriptInclude'

 

};

 

Thanks.

reshmapatil
Tera Guru

Hi,

 

To get response: 

Business Rule:

var testSI = new testScriptInclude();

var returnVal = testSI.testFunction(param1, param2,.......);

gs.info('returnVal: '+returnVal);  // you will get log as returnVal: true

 

Script Include (Name: testScriptInclude)

var testScriptInclude = Class.create();

testScriptInclude.prototype = {

        initialize: function() {

        },

testFunction: function(param1, param2,.......) {

response = 'true';

 return response;

},

type: 'testScriptInclude'

 

};