It's all about the answers!

Ask a question

How to update an unassigned enumeration attribute using web APIs


0
1
Myles F (145) | asked Feb 27 '15, 5:32 p.m.
edited Feb 27 '15, 6:11 p.m.
Hello,

Normally it is possible to update an attribute in RTC using OSLC with a PUT request.  For instance to update an enumeration list attribute on workitem 31389, I could send the following as a PUT:

URL:
https://my.rtc:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/31389

Request body:
<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_mUNZQ/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/31389">
    <j.2:customMultiSelect rdf:resource="https://my.rtc:9443/ccm/oslc/enumerations/_2KmWk641EeSEpKaM_mUNZQ/enumerationList$customEnum/customEnum.literal.l3"/>
    </j.0:task>
</rdf:RDF>

If a value was already set on the attribute, my item will be returned and list the updated value, but if the attribute was unassigned, I will get the following error when I try to set an initial value:

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:oslc="http://open-services.net/ns/core#" >
    <rdf:Description rdf:nodeID="A0">;
        <oslc:message>assertion failed: </oslc:message>
        <oslc:statusCode>500</oslc:statusCode>
        <rdf:type rdf:resource="http://open-services.net/ns/core#Error"/>;
    </rdf:Description>
</rdf:RDF>

This appears to effect both enumerations and enumeration list attributes.  Is there anyway to assign a value to an enumeration atttribute that does not already have a value assigned?

Be the first one to answer this question!


Register or to post your answer.