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

Can an artifact with a labeled link be created using the OSLC API?

 I've been attempting to create artifacts against RTC 6.0.x that include links with labels. Questions such as https://jazz.net/forum/questions/151611/using-oslc-api-to-create-a-workitem-with-a-relatedartifact-type-of-link indicate this is possible but I haven't been able to make this work.


An example body of a POST request to a URL like "https://my-server:9443/ccm/oslc/contexts/_4ApvgFlDEeaDHtB25fULWg/workitems/task" (using header "OSLC-Core-Version: 2.0") creating a new artifact with a link:

<rdf:RDF
   xmlns:dcterms="http://purl.org/dc/terms/"
 <j.0:task>
   <dcterms:title rdf:parseType="Literal">Test artifact including a labeled link</dcterms:title>
   <j.2:tracksChangeSet rdf:resource="https://example.com/path/ada74a3d-164c-4a89-b9f2-4fd44fbfe550" j.2:label="special link label"/>
 </j.0:task>
</rdf:RDF>

When I use a Content-Type header value of "application/x-oslc-cm-change-request+xml", I get a 415 response with the message "Content type 'application/x-oslc-cm-change-request+xml' is not supported.".

When I use a content type of "application/rdf+xml" I get a 500 response with the message "null for literals has been illegal since Jena 2.0".

Should something like this be possible? Is there an error in my request, or a workaround?

Cheers

0 votes

Comments

I can include a link in the creation without any problems but not the label. I have the impression that the label is automatically generated. Forget about OSLC for a moment, how can you add a linked item with a custom label?


Accepted answer

Permanent link

 Currently you can create links while creating a work item using OSLC apis but you cannot create labeled links, in the xml you have posted, if you remove  j.2:label="special link label" then it creates a new work item with the link for the remote change set. Is this something that would work for you or do you need the label as well?

Michael Nelson selected this answer as the correct answer

0 votes

Comments

 Thank you, Sharoon. Being able to write the label is the key functionality I was hoping for; we are already creating work items with unlabeled links. It sounds like writing links with labels is not currently possible; thank you for confirming this.

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

Question asked: Jun 21 '17, 5:36 p.m.

Question was seen: 1,920 times

Last updated: Jun 27 '17, 3:58 p.m.

Confirmation Cancel Confirm