It's all about the answers!

Ask a question

How to update workitem setting an empty collection using REST?


Cesar Augusto Silva Toschi (5818) | asked Apr 07 '16, 3:19 p.m.
//Add a new members in a collection. This work fine
{
  "rtc_cm:br.sicredi.team.workitem.attribute.componentversionList": [
 {
"rdf:resource": "https://app1dessist002l.lrn.sicredi.net:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/899"
 },
 {
"rdf:resource": "https://app1dessist002l.lrn.sicredi.net:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/901"
 }
  ],
}

//Remove one item from a collection. This work fine to
  "rtc_cm:br.sicredi.team.workitem.attribute.componentversionList": [
    {
      "rdf:resource": "https://app1dessist002l.lrn.sicredi.net:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/899"
    }
  ]


//Empty a collection. This does not work. There is no error, but nothing happing
{
  "rtc_cm:br.sicredi.team.workitem.attribute.componentversionList": [],
}

This is the command used to update in all tests
curl -k -b $COOKIES -H "Accept:application/x-oslc-cm-change-request+json" -H "Content-Type:application/json" -H "If-Match: \"$ETAG\"" -X PUT --data-binary "@$WIID.json" "$HOST/resource/itemName/com.ibm.team.workitem.WorkItem/$WIID

Accepted answer


permanent link
Donald Nong (14.5k414) | answered Apr 15 '16, 5:26 a.m.
You need to change the URL a bit. For details, see this post:
https://jazz.net/forum/questions/98302/oslc-how-to-remove-subscribers-with-oslc

Basically the URL in your case should become:
$HOST/resource/itemName/com.ibm.team.workitem.WorkItem/$WIID?oslc_cm.properties=rtc_cm:br.sicredi.team.workitem.attribute.componentversionList
Cesar Augusto Silva Toschi selected this answer as the correct answer

Your answer


Register or to post your answer.