How to pass parameters to this script include from Business Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2020 11:04 AM
How to pass parameters to this script include from Business Rule and also how to get response?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2020 11:09 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2020 11:12 AM
Hello yogesh,
Please refer below link,
Hope this will help you.
Kindly mark an answer as correct and helpful if it will resolve your query.
Regards,
Akshata
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2020 11:51 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2020 11:55 AM
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'
};