Service Request Attachment in Groovy
Summary:
Read Service Request Attachment in Groovy and Encode to Base64
Content (please ensure you mask any confidential information):
We have image attachment in Service Request. We want to send it to external system. External system accepts only Base 64 encoding. How can we achieve this? We have tried multiple methods but they are not working. See below.
Version (include the version you are using, if applicable):
23C
Code Snippet (add any code snippets that support your topic, if applicable):
Different functions we tried:
while(Attachment.hasNext()) {
def singleAttchment=Attachment.next();
def content=singleAttchment.FileContents;
//def content2=content.getBytes(1l, (int)content.length());