It's all about the answers!

Ask a question

Trouble creating custom workItem with required custom attributes using RTC Rest API


Spencer Clark (114) | asked Feb 02 '16, 1:30 p.m.
edited Feb 02 '16, 1:30 p.m.
Here is the error message I am receiving submit a request using a python script:

<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>'Save Work Item' failed. Preconditions have not been met: The 'Date Detected' attribute needs to be set (work item &lt;01:12:56&gt;).</oslc:message>
    <oslc:statusCode>403</oslc:statusCode>
    <rdf:type rdf:resource="http://open-services.net/ns/core#Error"/>
  </rdf:Description>
</rdf:RDF>

Here is the request I am submitting:
<rdf:RDF xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/"
rdf:about="https://rtc01.aide.oit.va.gov/jazz/resource/itemName/com.ibm.team.workitem.WorkItem"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"
xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/"
xmlns:oslc_pl="http://open-services.net/ns/pl#">
<rdf:Description rdf:nodeID="A0">
<dc:title rdf:parseType="Literal">New Title</dc:title>
<dc:subject>Chicken</dc:subject>
<dc:description rdf:parseType="Literal">New Description</dc:description>
<rtc_cm:dateDetected >2015-01-01T17:00:00.000Z</rtc_cm:dateDetected>
</rdf:Description>
</rdf:RDF>

As I have listed above, I submit a value for the attribute. Also, the type of the attribute is time-stamp.

Currently, I am at a lost of how to remedy this. Any insight will help.

Thanks in advance.

One answer



permanent link
Donald Nong (14.5k414) | answered Feb 02 '16, 7:12 p.m.
Pay attention to the name space. It's <rtc_ext:datedetected>, not <rtc_cm:datedetected> - at least this is true in my RTC 5.0.2 environment.

Also, I'm keen to know how you can get away without the <rtc_cm:type> attribute - I just can't create a defect in my environment without specifying the work item type.

P.S. Why do you specify rdf:nodeID="A0" in the <rdf:description>?

Comments
Spencer Clark commented Feb 03 '16, 10:44 a.m. | edited Feb 03 '16, 8:30 p.m.

When I tried <rtc_ext:datedetected>, the following error message appears:

<oslc:message>org.xml.sax.SAXParseException: The prefix "rtc_ext" for element "rtc_ext:dateDetected" is not bound.</oslc:message>
    <oslc:statusCode>400</oslc:statusCode>

So I assume the rtc_cm is the correct namespace.

Also, tried to swamp out <rdf:description> parent element with <oslc_cm:changerequest> with the same result.

Furthermore, I do not know why the attribuyte rdf:nodeID="A0" was specified, however, removing the attribute does not affect the outcome. Lastly, I am using version 5.0.2 as well.

Thank you. 


Donald Nong commented Feb 03 '16, 8:32 p.m.

That's strange. You can create such a work item in the Web GUI first, and do an OSLC GET to confirm the presentation of the "Date Detected" attribute - that's what I usually do. Other than that, I cannot think of anything else.


Spencer Clark commented Feb 11 '16, 9:36 p.m.

Thanks Donald,

I tried this and got the same thing back. Could it be possible the name was to date detected and this wasn't properly handled with the API?


Donald Nong commented Feb 11 '16, 9:44 p.m.

By "same thing", do you mean the attribute has the namespace "rtc_cm", rather than "rtc_ext"? If so, I would like to see how the attribute is defined in the process configuration. When I add such an attribute, it will have the namespace "rtc_ext". It's probably that the attribute is defined differently than I thought on your end.

Your answer


Register or 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.