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

Change the status of workitem in RTC(4.0) using REST API

Hi Team,

I have tried to change the status of workitem using Rest Api in RTC 4.0.6. But not able to update status of workitem.

Headers:
Accept:text/json
Content-Type:application/x-oslc-cm-change-request+json
If-Match:29c27c1b-cbfa-3745-baf6

URL:
https://ratsuitein131.in.dst.ibm.com:9444/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/102066

JSON Body
{
"dc:identifier":102066,
  "rtc_cm:state":{
    "rdf:resource":"https://ratsuitein131.in.dst.ibm.com:9444/ccm/oslc/workflows/_S-BFgSK4EeKBhX83Q/states/bugzillaWorkflow/3"
   }
}

Using PUT Method return these response.

Response Headers
    Status Code: 412 Precondition Failed
    Cache-Control: private, max-age=0, must-revalidate
    Connection: Close
    Content-Language: en-US
    Content-Type: text/json;charset=UTF-8
    Date: Thu, 01 Jan 2015 07:11:55 GMT
    Expires: Thu, 01 Jan 2015 07:11:56 GMT
    Transfer-Encoding: chunked
    Vary: Accept
    X-Powered-By: Servlet/3.0

Respose Body
{
    "oslc_cm:message": "CRJAZ0007I Unable to update the item identified by \"https:\/\/ratsuitein131.in.dst.ibm.com:9444\/ccm\/service

\/com.ibm.team.repository.common.internal.IItemRestService\/itemName\/com.ibm.team.workitem.WorkItem\/102066\" - there is a later version of this item available.",
    "oslc_cm:status": 412
}


Some ref link that I already have followed:

https://jazz.net/forum/questions/45192/update-workitem-status-with-oslc-api.
https://jazz.net/forum/questions/32674/change-workitem-state-via-rest?redirect=%2Fforum%2Fquestions%2F32674%2Fchange-workitem-state-via-rest
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Update_a_Work_Item
https://www.youtube.com/watch?v=eXVWtiuygr0

I would appreciate if anyone could gives some lights.

Regards,
Rupam

0 votes



One answer

Permanent link
 Hello Rupam,
either there is a more recent of the work item that you're trying to update,
which I doubt -
or there is some precondition in place that prevents from changing the status.

Possibly try and do the same operation using the WebUI
and see if it works.

Eric

0 votes

Comments

Yes Eric.

I can change the status using WebUI and it is working fine.
But getting error for rest calling.

Rupam


 Umm...

Hello Rupam,
anything you may notice in the ccm.log?

Eric

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,939

Question asked: Jan 02 '15, 5:00 a.m.

Question was seen: 4,678 times

Last updated: Jan 02 '15, 7:22 a.m.

Confirmation Cancel Confirm