How change RTC work item state in OSLC
Hello!
I'm trying to change a work item state with a simple HTTP PUT request. I do a request:
Headers:
Content-Type - application/x-oslc-cm-change-request+xml
Accept - application/x-oslc-cm-change-request+xml
I tried several URLs, for example such ones:
Every request, I get a response:
<?xml version="1.0" encoding="UTF-8"?><oslc_cm:error xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/">
<oslc_cm:status>400</oslc_cm:status>
<oslc_cm:message>Malformed XML: Premature end of file.</oslc_cm:message>
</oslc_cm:error>
Can somebody tell me what is wrong?
Thank you!
I'm trying to change a work item state with a simple HTTP PUT request. I do a request:
Headers:
Content-Type - application/x-oslc-cm-change-request+xml
Accept - application/x-oslc-cm-change-request+xml
I tried several URLs, for example such ones:
- https://localhost:9443/ccm/oslc/workitems/154?action=com.ibm.team.workitem.defectWorkflow.action.startWorking
- https://localhost:9443/ccm/oslc/workitems/154?_action=com.ibm.team.workitem.defectWorkflow.action.startWorking
- https://localhost:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/154?action=com.ibm.team.workitem.defectWorkflow.action.startWorking
- https://localhost:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/154?_action=com.ibm.team.workitem.defectWorkflow.action.startWorking
Every request, I get a response:
<?xml version="1.0" encoding="UTF-8"?><oslc_cm:error xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/">
<oslc_cm:status>400</oslc_cm:status>
<oslc_cm:message>Malformed XML: Premature end of file.</oslc_cm:message>
</oslc_cm:error>
Can somebody tell me what is wrong?
Thank you!
2 answers
Please see: https://www.google.com/search?q=change+RTC+work+item+state+in+OSLC+site%3Ajazz.net
which leads to several hits. the first leads to https://jazz.net/forum/questions/32674/change-workitem-state-via-rest and hopefully addresses your question.
Using a search engine and appending site:jazz.net as a keyword leads to hits for these popular questions that have been answered already.
which leads to several hits. the first leads to https://jazz.net/forum/questions/32674/change-workitem-state-via-rest and hopefully addresses your question.
Using a search engine and appending site:jazz.net as a keyword leads to hits for these popular questions that have been answered already.
It's a strange behavior of REST interface but I was able to change a state by a simple addition of request body like this one:
<?xml version="1.0" encoding="UTF-8"?><oslc_cm:ChangeRequest xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/" rdf:about="https://localhost:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/154" xmlns:dc="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/" xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/" xmlns:oslc_pl="http://open-services.net/ns/pl#">
</oslc_cm:ChangeRequest>
But I suspect that it's made for changing work item's properties simultaneously with state transition if necessary!
<?xml version="1.0" encoding="UTF-8"?><oslc_cm:ChangeRequest xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/" rdf:about="https://localhost:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/154" xmlns:dc="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/" xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/" xmlns:oslc_pl="http://open-services.net/ns/pl#">
</oslc_cm:ChangeRequest>
But I suspect that it's made for changing work item's properties simultaneously with state transition if necessary!