Scripts can extend the function of your knowledgebase by automating events such as moving files to a specific directory on the server. Scripts are executed by creating a script action within a rule or action button.
Scripts are automatically executed by the correct interpreter based on their file extension:
- .pl files are executed by the Perl interpreter.
- .py files are executed by the Python interpreter.
- .class files are executed by the Java interpreter.
- .jar files are executed by the Java interpreter. Main class is taken from the Script-Class Manifest entry.
- .exe files are executed as standalone programs.
Make sure your script does not contain unencrypted login credentials, passwords, or tokens. Instead, encrypt this information or store it in the KB so only an admin can access it.
For example, instead of including a plain-text password in the script itself, you could store the password in the KB and direct the script to retrieve the password value:
This also makes it simpler to update the password by simply updating it in the KB.