Retrieve and parse attachment info

The function below performs the following tasks:

  • Retrieves attachment information from the endpoint, such as file name, extension, size, and mime_type.
  • Set all these information to the CEAttachmentInfor object and return the CEAttachmentInfor object in an array.

For Service Anywhere, all attachment information comes from the REST response of Incident. For other endpoints, an additional REST request may be required to retrieve the information.

Out-of-box function:

CaseExchange_SAWUtil.getAttachmentInfor

The function has the following parameters:

  • mapObj: Final Service Manager value object after field mapping and value mapping.
  • sm: Temporary Service Manager value object after copying basic data from end point according to field mapping.
  • ep: Original value object from the end point.
  • context: Context of the SMIS task. You can get a specific value by using the context['internalId'] syntax.
  • param: All parameters defined in SMIS configuration. You can get a specific parameter value by using the param['object'] syntax.

For more information about these parameters, see Placeholder objects.

The function returns the following result:

Array: Array of the CEAttachmentInfo object