public String addAttachment(String containerId, Number taskId, String userId, String name, String attachmentPayload, String marshallingType) { containerId = context.getContainerId(containerId, new ByTaskIdContainerLocator(taskId.longValue())); logger.debug("About to unmarshal task attachment from payload: '{}'", attachmentPayload); Object attachment = marshallerHelper.unmarshal(containerId, attachmentPayload, marshallingType, Object.class); logger.debug("About to add attachment on a task with id '{}' with data {}", taskId, attachment); Long attachmentId = userTaskService.addAttachment(containerId, taskId.longValue(), getUser(userId), name, attachment); String response = marshallerHelper.marshal(containerId, marshallingType, attachmentId); return response; }