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

How to update workitem setting an empty collection using REST?

//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

0 votes


Accepted answer

Permanent link
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

0 votes

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,936
× 478
× 137
× 11

Question asked: Apr 07 '16, 3:19 p.m.

Question was seen: 2,916 times

Last updated: Apr 15 '16, 5:26 a.m.

Confirmation Cancel Confirm