I am trying to create a calculated pre-condition to prevent incidents from being reopened after 5 business days. I have a calculation that makes sense to me but when I try to implement it, I get an XML error on closed incidents.
static def GetAttributeValue(Incident):
Expired = 'True'
if Incident.Status.Title == 'Closed':
ClosureTime = Incident.Closures.LastUpdate()
TimeSinceClosure = Incident.GetBusinessTime(ClosureTime.CreationDate, DateTime.UtcNow)
if TimeSinceClosure.TotalHours < 40:
if DateTime.Today.DayOfWeek != DayOfWeek.Saturday and DateTime.Today.DayOfWeek != DayOfWeek.Sunday:
Expired = 'False'
Any ideas or is this something that can't be done?