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

Insert 'Link to' to existing requirements artifact

I've been working with OSLC and the WorkitemsApi lately and successfully managed to add comments and links to workitems just by executing the Java application. Here a code snippet how this looks like in the WorkitemsApi:

  @Override
  public synchronized RtcComment addComment(long id, String text) throws IOException {
    loginIfNeeded();
    return transport.post(
        "/oslc/workitems/" + id + "/rtc_cm:comments",
        RtcComment.class,
        Transport.APP_JSON,
        new BasicNameValuePair("dc:description", text));
  }

I am looking for a similar way to also insert links, for example a 'Link to', into an existing requirement. I have found ways to do this after creating an artifact, because then you have the correct identifier of the artifact. But what if I only have the human readable ID like 12345, or the url to the artifact?

Actual question:
How do I insert a link into a requirement by a simple REST query in Java?

0 votes

Comments

I mean like a http POST or something similar



2 answers

Permanent link

 You can not insert anything into anything using a REST Query. 

0 votes

Comments

I believe that is how jazz handles things though. Of course I'm open to other ways as well, as long as it works.

A QUERY is a means to find a list of something. 


Permanent link

 As far as my knowledge goes and that is not very far, the RM application is OSLC compliant. 


In OSLC, you would GET the URI of the element to get the object representation in the response body. 
  • You can then modify said representation you create from the response body. 
    • You can add something like a link 
    • You can remove something like a link
  • You send a PUT back with the OSLC headers and the request body created from the representation
Please see http://www.oasis-oslc.org/ for the OSLC specification.

0 votes

Comments

The same applies to the RTC Work Item REST/OSLC API. 

Yes that is also what I know. But how in detail would this look like?

Here a hint: https://jazz.net/library/article/635 


I have provide another one, look at OSLC. 
There are also examples here in the forum. 
We have consultants you can hire for this. 

Also see https://github.com/eclipse/lyo.client and the OSLC Java examples.


Also https://jazz.net/library/article/1001 and linked information. Best I can do.

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

Question asked: Jan 31 '19, 4:29 a.m.

Question was seen: 1,810 times

Last updated: Jan 31 '19, 5:45 a.m.

Confirmation Cancel Confirm