That is because when the script is evaluated in the sandbox, all possible known values are not known. The value is applied to the incident after the script is run as a result of potential changes made by the script. At that point, python is no longer involved so there is no opportunity to catch an error like this.
Ben
------------------------------
Ben Lurie
------------------------------
Original Message:
Sent: Tue August 25, 2020 01:26 AM
From: Hanyu Lee
Subject: Error exception handling of multiselect type field value input
Hello,
I found out that when I input wrong value to multiselect type field in script,
I can't error-handle it.
Like, for example "hl11_policy_violations" is a multiselect type field.
there is no preset value named "lorem ipsum", so an error will occur. I tried to error exception handle it like this,
try:
incident.properties.hl11_policy_violations="lorem ipsum"
except:
pass
but it seems it doesn't handle the error, just puts an error log.
Is there any way to handle this error?
(Error Running Script: Unable to set value Lorem Ipsum for Field HL11. Policy Violations)
Thank you.
------------------------------
Hanyu Lee
------------------------------