code: @AfterReturning(pointcut = "anyMethod() && withAttachmentAnnotation()", returning = "result")
      public void attachment(final JoinPoint joinPoint, final Object result) {
          final MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
          final Attachment attachment = methodSignature.getMethod().getAnnotation(Attachment.class);
  
          final String title = Allure1Utils.getTitle(
                  attachment.value(),
                  methodSignature.getName(),
                  joinPoint.getThis(),
                  joinPoint.getArgs()
          );
  
          final byte[] bytes = (result instanceof byte[])
                  ? (byte[]) result : Objects.toString(result).getBytes(StandardCharsets.UTF_8);
          getLifecycle().addAttachment(title, attachment.type(), "", bytes);
      }
docs: Process data returned from method annotated with {@link ru.yandex.qatools.allure.annotations.Attachment}
  If returned data is not a byte array, then use toString() method, and get bytes from it using.