It's all about the answers!

Ask a question

Why are OSLC update requests causing artifact links to disappear?


Derek Bonderczuk (111) | asked Feb 12, 5:17 p.m.
edited Feb 12, 5:18 p.m.

 I am modifying a Capability workitem's "Planned For" attribute using OSLC requests from VBA.  When I modify the attribute using the following request, all of the linked items under the "Links" page disappear.


<?xml version="1.0"?>
    <oslc_cm:ChangeRequest>
        <rtc_cm:plannedFor>https://<server>/ccm/oslc/iterations/_HaogPoLeEemIA4r_U-X20w</rtc_cm:plannedFor>
    </oslc_cm:ChangeRequest>
</rdf:RDF>

I am using the following headers:

    http.setRequestHeader "Content-Type", "application/xml"
    http.setRequestHeader "Accept", "application/xml"
    http.setRequestHeader "OSLC-Core-Version", "2.0"

And I am sending the request to the following link:

https://<server>:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/12225

When I modify the same workitem/attribute using the web GUI, this does not happen.  Why is this happening and what can I do to avoid it?

4 answers



permanent link
Jim Amsden (19336) | answered Feb 13, 8:35 a.m.

 Try:

<rtc_cm:plannedFor rdf:resource="https://<server>/ccm/oslc/iterations/_HaogPoLeEemIA4r_U-X20w"/>


Comments
Derek Bonderczuk commented Feb 13, 8:51 a.m.

I just tried it and the same thing happens.  The workitem is updated and the links disappear. 


permanent link
Jim Amsden (19336) | answered Feb 13, 11:38 a.m.

 you may need to GET the resource, add your property then PUT to do the update. a PUT without a GET may be updating the whole resource, not just patching the properties you changed.



Comments
Derek Bonderczuk commented Feb 13, 12:29 p.m.
But if thats the case, then why aren't any other attributes changing?  Its just the links that are changing when I change any attribute.

permanent link
Jim Amsden (19336) | answered Feb 13, 2:33 p.m.

 Try OSLC-Core-Version=1.0


Comments
Derek Bonderczuk commented Feb 13, 3:32 p.m.

When I try that, I get this as a response:


 debug.Print(workItemDoc.xml)
<?xml version="1.0"?>
    <oslc_cm:status>415</oslc_cm:status>
    <oslc_cm:message>Content type 'application/xml' is not supported.</oslc_cm:message>
</oslc_cm:error>


permanent link
Jim Amsden (19336) | answered Feb 13, 3:37 p.m.

 Its probably expecting content-type=application/rdf+xml


Comments
Derek Bonderczuk commented Feb 13, 3:51 p.m.
Nope

<?xml version="1.0"?>
    <oslc_cm:status>406</oslc_cm:status>
    <oslc_cm:message>Content type 'application/rdf+xml' is not supported.</oslc_cm:message>

</oslc_cm:error> 

Your answer


Register or to post your answer.