How do I unassign all values from an enumeration list using the web APIs?
If I do PUT on my work item to https://my.rtc:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/123 and send a body like this, and it will unassign all values except for the one specified:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:j.0="https://my.rtc:9443/ccm/oslc/context/_2KmWk641EeSEpKaM_mUNZL/shapes/workitems/"
xmlns:j.1="http://open-services.net/ns/cm-x#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:j.3="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/"
xmlns:j.2="http://jazz.net/xmlns/prod/jazz/rtc/ext/1.0/">
<j.0:task rdf:about="https://my.rtc:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/123">
<j.2:customEnumList rdf:resource="https://my.rtc:9443/ccm/oslc/enumerations/_2KmWk641EeSEpKaM_mUNZL/enumerationList$customEnum/customEnum.literal.l1"/>
</j.0:task>
</rdf:RDF>
However it does not appear that I can unassign all values from the Enumeration List, although it is possible through the web UI. Does anyone know if there is a way to do this using the web APIs?
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:j.0="https://my.rtc:9443/ccm/oslc/context/_2KmWk641EeSEpKaM_mUNZL/shapes/workitems/"
xmlns:j.1="http://open-services.net/ns/cm-x#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:j.3="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/"
xmlns:j.2="http://jazz.net/xmlns/prod/jazz/rtc/ext/1.0/">
<j.0:task rdf:about="https://my.rtc:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/123">
<j.2:customEnumList rdf:resource="https://my.rtc:9443/ccm/oslc/enumerations/_2KmWk641EeSEpKaM_mUNZL/enumerationList$customEnum/customEnum.literal.l1"/>
</j.0:task>
</rdf:RDF>
However it does not appear that I can unassign all values from the Enumeration List, although it is possible through the web UI. Does anyone know if there is a way to do this using the web APIs?
One answer
To anyone that might be interested, if you add the attribute you wish the change as an oslc.properties argument to the end of your PUT update, and do not include an element for that attribute in the body, it will remove the value.
So, for my example, I would use the URL:
https://my.rtc:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/123?oslc.properties=rtc_ext:customenumlist
With a body like:
<rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:j.0="https://my.rtc:9443/ccm/oslc/context/_2KmWk641EeSEpKaM_mUNZL/shapes/workitems/"
xmlns:j.1="http://open-services.net/ns/cm-x#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:j.3="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/"
xmlns:j.2="http://jazz.net/xmlns/prod/jazz/rtc/ext/1.0/">;
<j.0:task rdf:about="https://my.rtc:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/123">;
</j.0:task>
</rdf:rdf>
So, for my example, I would use the URL:
https://my.rtc:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/123?oslc.properties=rtc_ext:customenumlist
With a body like:
<rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:j.0="https://my.rtc:9443/ccm/oslc/context/_2KmWk641EeSEpKaM_mUNZL/shapes/workitems/"
xmlns:j.1="http://open-services.net/ns/cm-x#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:j.3="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/"
xmlns:j.2="http://jazz.net/xmlns/prod/jazz/rtc/ext/1.0/">;
<j.0:task rdf:about="https://my.rtc:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/123">;
</j.0:task>
</rdf:rdf>
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Feb 26 '15, 7:18 a.m.Myles F
Feb 26 '15, 11:48 a.m.Myles F
Feb 26 '15, 4:25 p.m.Myles F
Feb 27 '15, 5:07 p.m.