It's all about the answers!

Ask a question

Bad Request error when adding a link

Eric Bordeau (27632) | asked Aug 03 '09, 9:07 a.m.
I'm trying to add a link to an existing work item using REST/OAuth. I get the work item, find its element and get the oslc_cm:collref attribute. From here, I've tried 2 different approaches. First, I tried following the instructions here: That says to POST a new link entry to the collection URL. Second, I tried getting the collection, adding a new element and doing a PUT on the collection URL. Both of these ended up with a Bad Request error.

Is there any way to figure out what's wrong with my request? I have no idea where to go from here.


2 answers

permanent link
Eric Bordeau (27632) | answered Aug 03 '09, 12:22 p.m.
More specific info:

1) I set up OAuth and have a valid token.
2) I have a URL for a work item: https://localhost:9443/jazz/resource/itemName/
3) I GET that work item
4) I find the element
5) I get the oslc_cm:collref attribute
6) I POST to the collref URL using the following:
Content-Type: application/x-oslc-cm-change-request+xml
Accept: application/xml
content: <rtc_cm:Reference rdf:resource="someURL" oslc_cm:label="foo" />

I have also tried getting the collection, modifying it and doing a PUT with the whole collection.

permanent link
Arun Batra (14612226) | answered Jan 18 '12, 8:22 a.m.
I understand the topic is quite old, but for someone who comes across this link searching for a solution, a link can be added using oslc directly using a request of the following type.

Request URL : https://yourserveraddress/ccm/resource/itemName/<workItemId>
Request Method : PUT

Headers :

Request Body:


Your answer

Register or to post your answer.