Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
I am trying to extract an image from the Document workflow. (See attached)
The respective jsp file code for this is :
ArrayList attachement = (ArrayList) getFieldValue (cmdRunner, childId, "Text Attachments");
if (attachement != null && attachement.size () > 0) {
if (text.length () > 0) {
text += "<br>";
}
text = text + "<b><<Attachment>></b>"; // This line seem in correct.
Any body know how to extract the image ?
Appreciate your help.
Do you need to download the image, or just add a link to it?
For a link, you need to know the Attachment field ID (in this case the ID for "Text Attachments" which you can get by running im fields --fields=id,name "Text Attachments"). ), the attachment name, and the item number:
http://servername:port/im/viewattachment?issue=itemid&attachment=attachmentname&fieldID=attachmentfieldID
To get the attachment name, use getAttachments("Text Attachments") to get an array of the attachment names.
If you need to download the image, then you need to use the attachment bean: getAttachmentBeans("Text Attachments")
From the attachment bean, you can get the contents of the attachment using getContent(java.io.OutputStream out).
Dear awalsh,
Thanks very much for the help.
I still working on it, I will update again regarding the outcome.
Thanks verymuch
Andy