You use a wizard to create an action launch point with service request as the object. You can paste script code directly into the wizard.
Variable Name | Type | Binding |
---|---|---|
v_srclassif | IN | CLASSSTRUCTURE.CLASSIFICATIONID |
v_srattrdiameter | IN | TICKETSPECCLASS[ASSETATTRID='DIAMETER']. NUMVALUE |
v_srattrlen | IN | TICKETSPECCLASS[ASSETATTRID='LENGTH'].NUMVALUE |
v_servicegroup | OUT | COMMODITYGROUP |
#Check if the SR is classified as a pipe leakage
if v_srclassif=='PIPE_LEAK':
#Now calculate total volume of the pipe-formula is:3.14 * length * (diameter / 24) ^ 2
volume = 3.14 * v_srattrlen * (v_srattrdiameter / 24)**2
if volume < 1000:
#If volume is less than 1000 cubic feet, just assign SR to GROUP A
v_servicegroup = 'GROUP A'
else:
#If vol is greater than 1000 cubic ft, assign SR to GROUP B and create worklog
v_servicegroup = 'GROUP B'
# Now add the MBO API code to create a new record in the work log for the SR
worklogset = mbo.getMboSet ('WORKLOG')
worklog = worklogset.add()
worklog.setValue('clientviewable',1)
worklog.setValue('logtype','WORK')
worklog.setValue('description','System initiated processing-work assigned to GROUP B')