Why are OSLC update requests causing artifact links to disappear?
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"?>
<rdf:RDF xmlns:oslc_pl="http://open-services.net/ns/pl#" xmlns:rtc_ext="http://jazz.net/xmlns/prod/jazz/rtc/ext/1.0/" xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:oslc_cmx="http://open-services.net/ns/cm-x#" xmlns:acp="http://jazz.net/ns/acp#" xmlns:oslc_cm="http://open-services.net/ns/cm#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:oslc="http://open-services.net/ns/core#">
<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
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.
Try OSLC-Core-Version=1.0
Comments
When I try that, I get this as a response:
debug.Print(workItemDoc.xml)
<?xml version="1.0"?>
<oslc_cm:error xmlns:oslc_cm="http://open-services.net/xmlns/cm/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>
Its probably expecting content-type=application/rdf+xml
Comments
Nope
<?xml version="1.0"?>
<oslc_cm:error xmlns:oslc_cm="http://open-services.net/xmlns/cm/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>