How can I upload files to EWM defects programmatically?
How can I upload files (PDF of HTML) to defects in EWM programmatically? What is the correct endpoint/format for uploading attachments?
Tested approaches (all failed):
- POST to /ccm/oslc/contexts/{project}/attachments
Content-Type: application/octet-stream -> HTTP 415 Unsupported Media Type
Content-Type: text/html -> HTTP 415
Content-Type: multipart/form-data -> HTTP 415
- POST to IAttachmentRestService -> HTTP 501 Not Implemented
- POST to IWorkItemRestService/workItem/{id}/attachments -> HTTP 400
One answer
https://rsjazz.wordpress.com/2012/08/01/uploading-attachments-to-work-items/ Java API. AFAIK the API you are trying is internal and not documented. Some posts in this forum suggest others have been able to figure it out.