PUT request to update work item returns response 412 despite using up to date ETag
I'm trying to update work items through the API according to https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Update_a_Work_Item
One answer
I have successfully used the ETAG to update items. E.g. see the blog series here: https://rsjazz.wordpress.com/2022/02/02/ewm-work-item-oslc-cm-api/
Comments
My headers include 'Accept' = 'application/json' and 'Content-Type' = 'application/x-oslc-cm-change-request+json'.
The If-Match has to be "e204f6e9-355a-31f5-b818-694b14a35028". That API is ancient, I would suggest to rather use OSLC CM https://www.oasis-open.org/standard/oslc-cm-v3-0-ps01/ .
I have not found a pair of Content-Type and Accept headers that successfully worked for me.
Does the new API only support rdf+xml? I've been trying it with ld+json and it returns 406 regardless of accept or content type headers.
I provided all the headers I used in my comments.
This is the specification: https://docs.oasis-open-projects.org/oslc-op/core/v3.0/oslc-core.html
Comments
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Dec 13 '24, 4:42 a.m.You should copy literally whatever's in the ETag header into If-Match - don't modify or remove quotes even if it appears to have them. Not sure about EWM but for DOORS Next the ETag looks like it is in double quotes ETag: "%220%22&_6CYSGZd9Ee-u9O23RJI2Og" and these must be kept when copying to the If-Match.