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

How to update status of a defect in RTC using Rest API

We have a need to update the status of the defect/observation logged in RTC. We are trying to leverage the Rest Apis published for Jazz toolsets.

 

URL used: https://<domian name>/ccm/resource/itemOid/com.ibm.team.workitem.WorkItem/_QfJAMJcWEei2nqqtDv7JZg?_action=com.ibm.team.workitem.impedimentWorkflow.action.startWorking

 

HttpMethod Used: HttpPut

 

Json Request: {"dc:identifier":"<observation ID>","rtc_cm:Status":{"rdf:resource=":"https:\/\/<domain name>\/ccm\/oslc\/workflows\/_w1ldJRkGEeWDiM8aLc-GlA\/states\/com.ibm.team.workitem.impedimentWorkflow/com.ibm.team.workitem.impedimentWorkflow.state.s3"}}

 

Note: For observations we have the below three states:

State: Invalid

<rtc_cm:Status rdf:resource="https://<domain name>/ccm/oslc/workflows/_w1ldJRkGEeWDiM8aLc-GlA/states/com.ibm.team.workitem.impedimentWorkflow/com.ibm.team.workitem.impedimentWorkflow.state.s3">

 

State: New

<rtc_cm:Status rdf:resource="https://<domain name>//ccm/oslc/workflows/_w1ldJRkGEeWDiM8aLc-GlA/states/com.ibm.team.workitem.impedimentWorkflow/com.ibm.team.workitem.impedimentWorkflow.state.s1">

 

State: Resolved

<rtc_cm:Status rdf:resource="https://<domain name>//ccm/oslc/workflows/_w1ldJRkGEeWDiM8aLc-GlA/states/com.ibm.team.workitem.impedimentWorkflow/com.ibm.team.workitem.impedimentWorkflow.state.s2">

 

The observation <observation ID> had the status as https://<domain name>//ccm/oslc/workflows/_w1ldJRkGEeWDiM8aLc-GlA/states/com.ibm.team.workitem.impedimentWorkflow/com.ibm.team.workitem.impedimentWorkflow.state.s1

 

Http Headers used:

              updateDefect.addHeader("Content-Type", "application/x-oslc-cm-change-request+json");

              updateDefect.addHeader("accept","text/json");

              updateDefect.addHeader("User-Agent", "MSIE 8.0");

 

Sample code:

StringEntity defrequest = new StringEntity(jsonRequest.toString());

updateDefect.setEntity(defrequest);

HttpResponse defectResponse = client.execute(updateDefect,context);

 

 

Output:

 

Http Response: 200

 

However the status of the observation still stays as https://<domain name>//ccm/oslc/workflows/_w1ldJRkGEeWDiM8aLc-GlA/states/com.ibm.team.workitem.impedimentWorkflow/com.ibm.team.workitem.impedimentWorkflow.state.s1

0 votes



One answer

Permanent link

 The state of a work item is read only. You have to submit a valid work flow action to get the state transition triggered.

0 votes

Comments

Hi Ralph,

Could you please share some examples on the valid work flow action that you are referring to. Are you referring to the action we are passing in as a parameter.

I don't have anything that I could share. https://www.google.com/search?q=OSLC+work+item+change+state+site%3Ajazz.net shows several forum questions and there are some that seem to have made progress. 

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

Question asked: Oct 23 '18, 2:04 a.m.

Question was seen: 2,070 times

Last updated: Oct 30 '18, 9:08 a.m.

Confirmation Cancel Confirm