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

Howto set tracks and implementsWorkItem links via OSLC

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.

0 votes


Accepted answer

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

0 votes

Comments


2 other answers

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

0 votes


Permanent link

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


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,937
× 62

Question asked: Nov 26 '21, 8:41 a.m.

Question was seen: 1,223 times

Last updated: Nov 28 '21, 9:05 a.m.

Confirmation Cancel Confirm