I want to create a request from an incident with an automatic action.
This works fine, but I'm not able to access data from Incident in a calculation.
I want to set the same category in request as in the incident.
First try in script:
static def GetAttributeValue(Request):
Value = null
ICat = Request.RequestIncidents.Incident.Category.Title
Value = Request.GetObjectByAttribute("RequestManagement.Category", "Title", ICat)
Error message is:
Field 'Touchpaper.Framework.Data.DataObjectListProxy.Incident' not found.
ICat = Request.RequestIncidents.Latest().Incident.Category.Title
Error Message is:
Object reference not set to an instance of an object.
When i try it in the request window of the automatic Action the title is copied to the request:
Any idea what is the correct syntax to get the incident field at create request?
Try a FOR loop:
for i in Request.RequestIncidents:
ICat = i.Incident.Category.Title
Don't know why, but this works.
Retrieving data ...