- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2023 03:20 AM
I have a onLoad Client Script on incident table which takes hard-coded values-
It calls the Script include -
The sys id in the client script is of the attachment added to the incident table, but it is hardcoded. To make it dynamic I wrote the same thing in BR. I wrote the BR on attachmet table as follows -
But it gives error as -
How to correct this
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2023 03:48 AM
Its better to use new script include :
Business Rule
var attachmentSysId = current.sys_id; //will pass in function parameter
var apiEndpoint = 'your link'; //will pass in function parameter
var si = new ZendeskSender(); //Script include
//store return value to use further
var getReturnValue = si.sendAttachment(attachmentSysId,apiEndpoint); // function
//do your activity
Script include :
sendAttachment : function (attachmentSysId , apiEndpoint) {
var attachment = new GlideSysAttchment();
//below code will be same as per your existing code
}
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2023 03:27 AM
Hi,
The GlideAjax call is used to interact between the client (browser) and the server (database).
A business rule runs on server side, so there is no need to call the GlideAjax (and the class is not defined here either).
You can instead call on your script include directly like so:
var someVariable = new global.ScriptIncludeName().functionName(parameters); // replace global with scopename if the scriptinclude is not a Global script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2023 03:31 AM
How can I call the two parameters that I have here

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2023 03:42 AM
If your script include function allows it, you can just add additional parameters, like below
var someVariable = new global.ScriptIncludeName().functionName(param1, param2, param3);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2023 03:45 AM
Providing another example, more close to your scenario:
new global.ZendeskSender().sendAttachment(current.getUniqueValue(), apiEndpoint);