It's all about the answers!

Ask a question

Howto set tracks and implementsWorkItem links via OSLC


Arthur Kleer (302) | asked Nov 26 '21, 8:41 a.m.
edited Nov 26 '21, 8:42 a.m.

Hello,


I am trying to set some links via OSLC API (e.g. Tracks and ImplementsRequirement).
Unfortunately, I did not find any way that works. The response from the server is always something like this:
 <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>Unknown attribute: http://jazz.net/xmlns/prod/jazz/calm/1.0/implementsRequirement</oslc:message>
    <oslc:statusCode>409</oslc:statusCode>
    <rdf:type rdf:resource="http://open-services.net/ns/core#Error"/>
  </rdf:Description>
</rdf:RDF>
I am sending the following data to the server
<?xml version='1.0' encoding='utf8'?>
<oslc_cm:ChangeRequest xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"
                       xmlns:dcterms="http://purl.org/dc/terms/"
                       xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/"
                       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                       xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/"
                       rdf:about="https://rtc.intel.com/ccm0001001/resource/itemName/com.ibm.team.workitem.WorkItem/379721">
<dcterms:title>Test - updated 3</dcterms:title>
<dcterms:description>updated 3 - desc</dcterms:description>
<dcterms:subject>t2020</dcterms:subject>
<calm:implementsRequirement oslc_cm:label="This is a label :)"
                            rdf:resource="<dng link here>"/>
<rtc_cm:com.ibm.team.workitem.linktype.parentworkitem.children oslc_cm:label="This is a label :)"
                                                               rdf:resource="<rtc link here>"/>
</oslc_cm:ChangeRequest>
Setting the children works, just as the other attributes work. When I try the implementsRequirement (and tracksWorkItem), it fails. I used calm:implementsRequirement as this is what I get from the server when I "GET" the work item, however I also tried oslc_cm:implementsRequirement as it seems to be in the oslc_cm vocabulary. 

The URI, that I am using:


What do I miss here?
I didn't find any information or examples on links beside children/parent.

Accepted answer


permanent link
Ralph Schoon (60.8k33643) | answered Nov 26 '21, 9:10 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
 When I do a GET at a work item that has such a link like
with
Accept application/rdf+xml 
OSLC-Core-Version 2.0

The link looks like

    <oslc_cm:implementsRequirement rdf:resource="https://elm.example.com:9443/rm/resources/TX_CVH28lpnEeuIQuHbrNptJw" />

When I PUT the response back with a new link added to the response from the GET, it works.
Arthur Kleer selected this answer as the correct answer

Comments
Ralph Schoon commented Nov 26 '21, 9:12 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

2 other answers



permanent link
David Honey (9256) | answered Nov 26 '21, 9:11 a.m.
JAZZ DEVELOPER
I see this for the implements requirement link from an example work item at https://localhost:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/175:

<https://localhost:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/175>
      a       oslc_cm:ChangeRequest ;
      ...
      oslc_cm:implementsRequirement <https://localhost:9443/rm/resources/TX_pInWIDGJEeyLOd9jXPyDKQ> ;
    
    
You should be performing an HTTP PUT on that work item URI - it shouldn't need parameters like oslc.properties or oslc.prefix . You may need to use an If-match header whose value is the etag from the previous GET.


permanent link
Arthur Kleer (302) | answered Nov 28 '21, 9:05 a.m.
edited Nov 28 '21, 9:05 a.m.

Thanks for the quick answer. I did not use the OSLC-Core-Version 2.0 header. Adding it fixed the problem.


Your answer


Register or to post your answer.