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

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?


0 votes

Comments

I doubt that I can see the correct XML. It might be useful to add a screenshot instead. I think you have to return the enumeration list with no literals at all.

Thanks for the reply Ralph. Do you know how I can send an enumeration list with no literals at all?
If I don't send the enumeration list attribute element at all in the XML body, no update happens (it keeps the previous values) for that attribute.

I have tried sending the following as elements in the XML body:
<j.2:customenumlist rdf:resource=""/>;
and
<j.2:customenumlist />
but that causes an error when I send the PUT

I've determined that if I add ?oslc.properties=rtc_ext:customenumlist to the end of the PUT url, and do not include an element for that attribute in the body, it will remove the value. 

However, once it's removed, I can not assign a new value using the PUT. If I try to include that element again in the next PUT body, I get this error

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

So I can only change the value if the attribute is already assigned. This seems like it might be a bug to me.

I've answered this question, and will open another one for the new issue I encountered and mentioned in the comment above.



One answer

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

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,934
× 515
× 478
× 457

Question asked: Feb 25 '15, 8:15 p.m.

Question was seen: 5,201 times

Last updated: Feb 27 '15, 5:07 p.m.

Confirmation Cancel Confirm