2 Replies Latest reply on May 16, 2017 7:07 AM by vfrank

    Access Incindent Data when creating request with calculation

    vfrank Rookie

      Hi,

      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)

      return Value

       

      Error message is:

      Field 'Touchpaper.Framework.Data.DataObjectListProxy.Incident' not found.

       

      Second try:

      static def GetAttributeValue(Request):

      Value = null

      ICat = Request.RequestIncidents.Latest().Incident.Category.Title

      Value = Request.GetObjectByAttribute("RequestManagement.Category", "Title", ICat)

      return Value

       

      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?

      Regards

      Volker Frank