It's all about the answers!

Ask a question

How to download an attachment through OSLC in RTC


Chandan M B (501259) | asked Apr 24 '15, 12:20 a.m.
Hi,
I have a WI and i have attached some files attached to it.
I need to get OSLC link for that attachment and if i click on it. It should directly start downloading an attachment

Regards,
Chandan

2 answers



permanent link
Donald Nong (14.4k213) | answered Apr 24 '15, 1:20 a.m.
Just do a simple GET of the OSLC 2.0 representation of the WI, and you should see something like this.
  <rdf:Description rdf:nodeID="A0" >
    <rdf:subject rdf:resource="https://clm/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/90"/ >
    <rdf:predicate rdf:resource="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/com.ibm.team.workitem.linktype.attachment.attachment"/ >
    <rdf:object rdf:resource="https://clm502.sydney.rcs:9443/ccm/resource/itemOid/com.ibm.team.workitem.Attachment/_Z3ocoOpAEeSl-YH_uIrcIw"/ >
    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/ >
    <dcterms:title>Attached File Name</dcterms:title >
  </rdf:Description >
Where "subject" is the WI itself, "object" is the OSLC link to the attachment, and "title" is the name of the attachment.
But I'm curious, when you said "click", did you mean working in a browser or a custom built application? If it's a browser, I can't see why you need to link since the RTC Web GUI allows you to download the attachment. If it's a custom built application, then the application has to handle this.


Comments
Chandan M B commented Apr 24 '15, 1:30 a.m.

Hi Donald,

Yes, i want to get OSLC link of attachment and pass it to my custom application through server side plugin.
In my custom application if i click on this OSLC link it should start downloading automatically.


permanent link
Lakshman Kakumani (11) | answered Aug 08 '18, 6:59 p.m.

 Hi,

good noon,

I have a custom requirement to implement the new functionality.

Step 1: Developer will create defect work item in RTC. 
Step 2: He will attach the text file to the work item.
Step 3: I need to write a script to download the attachment from work item & copy to specific directory  [Custom requirement ]
Step 4: I'll point the script into the build definition

Can you please guide me how to do the step 3 ?
Thank you
Lakshman

Your answer


Register or to post your answer.