You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 4 Next »
Server-side scripts allow the system to run the JS scripts on the server-side when the server events happen, for example:
They are used for creating reactions for the data writing based on the pre-defined rules, such as:
In the server-side scripts, you can use native JavaScript and methods provided by server-side API.
To define the API class in a script, you need to specify it explicitly in script code, for example:
class SimpleAutoAssigner { /** * @constructor * @param {string} autoAssignedRuleId */ constructor(autoAssignedRuleId) { this.autoAssignedRuleId = autoAssignedRuleId; this.assigner = this.__create(); this.userId = this.assigner.getUserId(); this.groupId = this.assigner.getGroupId(); } //...
In the case there is a code executed through the eval() function, adding the string below at the start of the script imports all the API classes.
// #import_all_types
The following sections give more details and specifics of server-side scripts usage.
Also, you can refer to the Scheduled Script article to get more information about implementing routine activities.