It's all about the answers!

Ask a question

How Can I Change Work Item Type via OSLC API?


Nate Decker (37814261) | asked May 29 '14, 4:45 p.m.

I was pretty sure someone else would have had this question, but I've searched here on the forums and haven't found anything so I thought I would ask.

I've been able to successfully manipulate work items in the past using the OSLC API. Currently I am trying to change a Work Item's type. I am passing XML specifying a new value for the dcterms:type attribute. The http response back from the server indicates "Ok" and includes XML for the work item (no error message of any kind). However, the type remains unchanged.

I did notice one oddity. I'm trying to change the work item from an execution item to a planning item and when I view the history of the work item, the "Actual Start Date" has changed from "Unassigned" to Now. This suggests that something under the hood actually occurred, but there is no indication of it in the presentation of the work item. The history does not show any other change.

Is there a special procedure that must be followed in order to change work item type via OSLC? Is it unsupported?


Comments
Charlie Seo commented Jun 01 '14, 9:26 p.m.

How did you change the work item type? Using PUT to update an existing workitem? I'm doubtful if that works since changing resoruce type would require other conditions to be met such as different attribute types and mandatory field.

If you could share more detailed steps you performed, that would easier for SME here to answer your question.

Accepted answer


permanent link
Donald Nong (14.5k414) | answered Jun 02 '14, 12:40 a.m.
Assuming that the source type and the target type are compatible, you can surely change the work item type using OSLC with the HTTP PUT option. But I only manage to do it with the URI with the internal Id. Here is a sample of the PUT body and the resource URI is in the rdf:about tag.I can change the type of the same work item from Task to Story to Defect in the JKE Banking sample project, without any visible problems.

<rdf:RDF
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:oslc_cm="http://open-services.net/ns/cm#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rtc_ext="http://jazz.net/xmlns/prod/jazz/rtc/ext/1.0/"
xmlns:oslc_cmx="http://open-services.net/ns/cm-x#"
xmlns:acp="http://jazz.net/ns/acp#"
xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_pl="http://open-services.net/ns/pl#" >
<rdf:Description rdf:about="https://<server>:<port>/ccm/oslc/workitems/_sy61IK2SEeOZZsxCNqN2HA/">
<rtc_cm:type rdf:resource="https://<server>:<port>/ccm/oslc/types/_YAOpUK2SEeOZZsxCNqN2HA/defect"/>
<dcterms:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Defect</dcterms:type>
</rdf:Description>
</rdf:RDF>
Nate Decker selected this answer as the correct answer

Your answer


Register or 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.