Script considerations

Review these important considerations when writing scripts.

Consider the following before writing a script:
  • You can use HTML tags to enter rich text for fields; however, you cannot use HTML tags with script tags (<script>). If you do, the HTML tags are stripped and the script may return invalid data.
  • For Python 2 scripts only, string literals in scripts are interpreted as ASCII by default and cannot contain other encodings. If you need to use other characters such as diacritics in your scripts, you need to declare them using a unicode string literal. For example:

    incident.name = u"Risikobewertung für Verstoß"

    For more details refer to the Sequence Types section in the Jython document.

  • Do not include a null terminated string ('\0') when writing to a data table field; otherwise, you will see a script error when the script runs. If running the script from a function's post-process script, the workflow may not complete. As a workaround, you can use the python rstrip command to strip the null character from the string when filling in the text field of data table, as follows:
    string.rstrip('\0')