Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Using PATCH on a change state REST call

Hi,
I'd like to change a work-item state and an attribute value at once using REST API. It works fine if I'm using this curl command:

curl -D - -k -b cookies.txt -H "If-Match: _AXqPgM2XEeCe6LQh8onYag" -H "Content-Type: application/json" -H "Accept: application/json" -X PUT --data-binary @update.json https://localhost:9443/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/44?_action=ReleaseZMFWorkflow.action.a2


On this article I've read that if I use PUT I have to put the entire json on update.json file. If I try PATCH I get an error that says that "the method is not implemented". I've tried to use PUT using a partial json, putting only the attribute I want to change and it works, but I'm not sure this is the "standard" way.

In order to use PUT and a subset of json file I should use oslc_cm.properties. But how can I use either _action and oslc_cm.properties on the same URL?

I'm using RTC 2.0.0.2

Thanks,
Michele.

0 votes



One answer

Permanent link
From the same article you cite:
Alternatively, you could use PATCH without the oslc_cm.properties parameter. Note that this works only for the alternative work item URLs like /jazz/oslc/workitems/{id}, but not for the Location based ones:
URL="https://localhost:9443/jazz/oslc/workitems/821"

curl -D - -k -b $COOKIES -H "Content-Type: application/x-oslc-cm-change-request+json" -H "Accept: application/json" -X PATCH --data-binary @changetype.json $URL


So, you could use the PATH action with URL:
https://localhost:9443/jazz/oslc/workitems/44?_action=ReleaseZMFWorkflow.action.a2

instead of:
https://localhost:9443/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/44?_action=ReleaseZMFWorkflow.action.a2


Cheers.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Aug 30 '11, 3:50 a.m.

Question was seen: 3,497 times

Last updated: Aug 30 '11, 3:50 a.m.

Confirmation Cancel Confirm