I have a business rule that overrides the severity on an incident if the user is a VIP. Works great. However, with a new department coming online I now need it to do nothing if a specific category is used (set in a template). I assumed I could use a calculation to check for VIP and the special category and return a severity to the business rule. The values 1, 3, and 4 correspond to the 1st, 3rd, and 4th values in my Severity object.
I have included the business rule, the calculation, and the results from the calculation log file in hopes that someone will see where I am going wrong.
static def GetAttributeValue(Incident):
Value = 99
if Incident.RaiseUser._VIP == "VIP": Value = 3
if Incident.Category.FullName == "Instructional Services - AV Equipment": Value = 1
if Value = 1: return Incident.GetRankedObject("IncidentManagement.Severity", 1)
if Value = 3: return Incident.GetRankedObject("IncidentManagement.Severity", 3)
if Value = 99: return Incident.GetRankedObject("IncidentManagement.Severity", 4)
Calculation Attribute Calculation Unsuccessful at 2012-02-14 15:27:44.415 Calculation successful for Attribute [_ISSeverity] on Class Type [IncidentManagement.Incident] On Object : Key = [bbd1e320-c6da-43c3-924d-382661982dc9] Name =  Calculated Value =  FAILED Type mismatch when attempting to set attribute value _ISSeverity.