Retrieving attachment contents using oslc
3 answers
See this discussion. Maybe that helps: https://jazz.net/forum/questions/150849/how-to-upload-an-attachment-to-a-work-item-via-rest-api it is for upload, but maybe there is a similar approach.
I only have code for uploading and downloading using Java in
https://rsjazz.wordpress.com/2012/09/21/downloading-attachments-from-work-items/
and
https://rsjazz.wordpress.com/2012/08/01/uploading-attachments-to-work-items/
I only have code for uploading and downloading using Java in
https://rsjazz.wordpress.com/2012/09/21/downloading-attachments-from-work-items/
and
https://rsjazz.wordpress.com/2012/08/01/uploading-attachments-to-work-items/
Not quite sure it's doable as it seems to be blocked in my environment. Here are the steps that I use.
1. Access the work item shortcut /ccm/resource/itemName/com.ibm.team.workitem.WorkItem/###
2. Locate the attachment in the XML presentation, which is the <rtc_cm:com.ibm.team.workitem.linktype.attachment.attachment> tag.
3. Access the attachment link /ccm/resource/itemOid/com.ibm.team.workitem.Attachment/xxxxxxxxxxxxx. The response contains details about the attachment, such as file type, file size and etc. The link to the actual file content is the <rtc_cm:content> tag.
4. Try to access the content link but I get this warning.
1. Access the work item shortcut /ccm/resource/itemName/com.ibm.team.workitem.WorkItem/###
2. Locate the attachment in the XML presentation, which is the <rtc_cm:com.ibm.team.workitem.linktype.attachment.attachment> tag.
3. Access the attachment link /ccm/resource/itemOid/com.ibm.team.workitem.Attachment/xxxxxxxxxxxxx. The response contains details about the attachment, such as file type, file size and etc. The link to the actual file content is the <rtc_cm:content> tag.
4. Try to access the content link but I get this warning.
You have followed a direct link to content hosted in a Jazz server. This page has been presented to ensure that a malicious website cannot use cleverly crafted content to circumvent security. If you would like to access the content, please use the link below.
Hi Donald-
You can’t actually see attachments using OSLC integration. Not only can you not read/retrieve the attachment, you don’t even know it’s there. The rich hover & Adapter UI functionality does not show attachments.
To retrieve an attachment, you could use the Rational Lifecycle Integration Adapters-Tasktop Edition (RLIA-TE), you can learn more about RLIA-TE here:
http://www-304.ibm.com/partnerworld/gsd/solutiondetails.do?&solution=46335&lc=en
Please feel free to reach out to me if you have any questions!
Thanks and Best
b
Beth Beese | Business Development Manager | Tasktop Technologies