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

OSLC/REST API: How to change the state AND resolution of a work item?

I want to change the state of a work item via the OSLC or Reportable REST API and I succeeded in doing this in most cases using the method described here: https://jazz.net/forum/answer_link/99991/. It basically works by POSTing to the work item URL appended with "?_action=[desired action]".

However this doesn't work for the action "Resolve" because it needs an extra field describing the Resolution (like "Invalid", "Fixed" etc.). I found that the list of possible resolutions is under the URL ...oslc/workflows/[Project Area UUID]/resolutions/com.ibm.team.workitem.defectWorkflow/. But how can I pass the resolution code to RTC, in addition to the "Resolve" action?

Additional information: If I try to change the state by the "Resolve" action, it fails with the message
{"oslc:message":"'Save Work Item' failed. Preconditions have not been met: The 'Root Cause Description' attribute needs to be set (work item 114391).","oslc:statusCode":403,"prefixes":{"oslc":"http://open-services.net/ns/core#"}}

1

1 vote


Accepted answer

Permanent link
Hello... I haven't tried this but it looks like you need to include the "Root Cause Description" and any other required attributes with the save. The Resolution is passed in as the attribute internalResolution.

http://open-services.net/bin/view/Main/CmRestApiV1
describes how to save.

Assuming the root cause description is called rootCauseDescription, the call would look something like this:

PUT {CR URI}?_action=bugzillaWorkflow.action.resolve&oslc_cm.properties=rootCauseDescription,internalResolution
Content:
<oslc_cm:ChangeRequest>
  <rootCauseDescription>Something broke.</rootCauseDescription>
  <internalResolution>5</internalResolution>
</oslc_cm:ChangeRequest>  

You will need to play around with this for the right content.
Fabian Zaiser selected this answer as the correct answer

0 votes

Comments

Thanks for your answer! I tinkered with it a bit and I could get it to work like this (written done for other people having this problem):

Calling the attribute "internalResolution" did NOT work for me, it has to be called "rtc_cm:resolution".

Send "text/json" (not "application/json", for some reason) as Content-Type and Accept header.

Send the following content:
{
  "rtc_cm:resolution": "com.ibm.team.workitem.defectWorkflow.resolution.r9"
}

where "com.ibm.team.workitem.defectWorkflow.resolution.r9" is just an example of a possible resolution.

The root cause description turned out to be just one of many attributes that had to be set on resolving, which can be configured, I think.

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,944
× 516
× 480
× 369
× 235
× 137
× 5

Question asked: Sep 02 '16, 7:12 a.m.

Question was seen: 4,666 times

Last updated: Sep 12 '16, 7:45 a.m.

Confirmation Cancel Confirm