Get IAttachment from UUID of RTC attachment
I've got a UUID of an RTC workitem. Now, I need to convert this UUID to IAttachment, so that I can save that attachment to disk.
When I use following API method, it returns me IAttachmentHandle, but I need IAttachment instead:
(IAttachmentHandle) IAttachment.ITEM_TYPE.createItemHandle(UUID.valueOf(attachmentUuid), null);
When I use following API method, it returns me IAttachmentHandle, but I need IAttachment instead:
(IAttachmentHandle) IAttachment.ITEM_TYPE.createItemHandle(UUID.valueOf(attachmentUuid), null);
Accepted answer
createItemHandle() creates a handle to the item a handle is not the item itself, it needs to be resolved to the item. There are different ways to do that, dependent on if it is client or server API. I assume this is client API. See
https://rsjazz.wordpress.com/2012/09/21/downloading-attachments-from-work-items/ for how this could be done. also see https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ for an overview of the most common questions when using the client API.
https://rsjazz.wordpress.com/2012/09/21/downloading-attachments-from-work-items/ for how this could be done. also see https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ for an overview of the most common questions when using the client API.