Hi All,
My objective is to put a default value in the service request classification box When selecting location like 'XX%'
I tested with the script below, Unfortunately it didn't work
Thanks for your help
from psdi.mbo import MboConstants
def retrieve_and_set_classification(mbo):
location = mbo.getString("LOCATION")
# Check if the location starts with 'XX%'
if location.startswith("XX%"):
# Retrieve classification based on CLASSSTRUCTURE.CLASSIFICATIONID
class_structure_set = mbo.getMboSet("CLASSSTRUCTURE")
class_structure = class_structure_set.getMbo(0)
if class_structure is not None:
# Check if the classification name is 'XXX_SR'
classification_name = class_structure.getString("CLASSIFICATIONID")
if classification_name == "XXX_SR":
# Set classification in SR.CLASSIFICATION
mbo.setValue("CLASSIFICATIONID", classification_name, MboConstants.NOACCESSCHECK)
# Trigger the script when a Service Request (SR) record is accessed
if mbo.getUniqueIDName() == "TICKETID":
retrieve_and_set_classification(mbo)