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));
}
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?
2 answers
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.
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.
Comments
Tim Reimer
Jan 31 '19, 4:59 a.m.I mean like a http POST or something similar