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

Problem with updating a WorkItem using Curl

Hi All,
I was using this useful guide: https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2 to try to manipulate WorkItems from a script.
There is a section  regarding update of a Work Item:
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Update_a_Work_Item
The issue is that I always get
HTTP/1.1 412 Precondition FailedServer: Apache-Coyote/1.1Cache-Control: private, max-age=0, must-revalidateExpires: Wed, 20 Mar 2013 08:26:32 GMTVary: AcceptContent-Type: application/x-oslc-cm-change-request+json;charset=UTF-8Transfer-Encoding: chunkedDate: Wed, 20 Mar 2013 08:26:32 GMT{    "oslc_cm:message": "CRJAZ0007I Unable to update the item identified by \"https:\/\/clm-demo:9443\/ccm\/service\/com.ibm.team.repository.common.internal.IItemRestService\/itemName\/com.ibm.team.workitem.WorkItem\/90\" - there is a laterversion of this item available.",    "oslc_cm:status": 412}
and the update does not work.
I was running these commands:
set URL="https://clm-demo:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/90"
curl -D - -k  -b %COOKIES% -o "wi-90.json" -H "Accept: application/x-oslc-cm-changerequest+json" %URL%

And from the ETag response, run this line:

curl -D - -k -b %COOKIES% -H "If-Match: 7250960a-8438-31d1-a97a-5ffba71fc94e" -H "Content-Type: application/x-oslc-cm-change-request+json" -H "Accept: application/x-oslc-cm-change-request+json" -X PUT --data-binary @wi-90.json %URL%

and got the error above.
Any Ideas?
Thanks!
Asaf













0 votes

Comments

Hi Asaf,

I'm getting the same message while updating the state of the workitem. Did you get around this issue?

Thanks,
Binoy



One answer

Permanent link

 Hi, I don't know the solution to your problem well, as I don't "work" with get calls, but the problem that gives you the classic conflict about workitems seems to me. I'll explain:

Java side, where I work practically to change the workitem you can't do it on the same direct but you have to instantiate a copy that will then receive the modification and that it will be saved and will update the original element. Maybe the other problem is similar. Try to see if you can retrieve the item after retrieving the item and "maneuver" that. I hope to be useful.

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
× 10,938
× 479
× 42
× 17

Question asked: Mar 20 '13, 4:37 a.m.

Question was seen: 7,307 times

Last updated: Dec 06 '19, 10:13 a.m.

Confirmation Cancel Confirm