It's all about the answers!

Ask a question

Is it possible to use the REST URI tool for attaching files when submitting a new record?


David Khetaguri (1114) | asked Mar 03 '16, 3:04 a.m.
edited Mar 03 '16, 3:12 a.m.
Short version: Is it possible to use the REST URI tool for attaching files when submitting a new record?

We have found that there is a tool in ClearQuest that's called REST URI, which makes it possible to prefill  a TR by adding parameters in the GET URI. In order to use this in a better way we would like to add file.zip attachment as well. However, it didnt work. 

We used a form:
method="POST" target="_blank"
enctype="multipart/form-data" action="https://our_host/cqweb/restapi/our_repo/our_database/RECORD?format=HTML&recordType=Defect&fieldsXml=<Field><Name>Attachments</Name><Value><![CDATA[file.zip]]></Value></Field>&autoSave=false&noframes=true">
       
       input type="file" name="attachment"
       input type="submit" value="click me!"                          


Error message was: 

No object could be found that allows the requested operation.

Details

problem converting 'cq.record:[ "file.zip" ]' into server resource for 'FLD:Attachments'.  No object could be found that allows the requested operation.


Does anybody knows if that is possible? Using POST somehow?

One answer



permanent link
Donald Nong (14.5k614) | answered Mar 03 '16, 4:41 a.m.
The request is definitely incorrect. I'm not familiar with the tool that you mentioned, and not sure whether it uses OSLC 2.0 only. If OSLC 2.0 only, you cannot do it at all, as working with attachments is only available in OSLC 1.0.
https://jazz.net/wiki/bin/view/Main/RcmRestCmApi
https://jazz.net/wiki/bin/view/Main/CqOslcV2

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.