Insert 'Link to' to existing requirements artifact
![]()
Tim Reimer (11●1)
| asked Jan 31 '19, 4:29 a.m.
edited Jan 31 '19, 4:44 a.m. by Ralph Schoon (63.3k●3●36●46)
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?
|
2 answers
![]()
Ralph Schoon (63.3k●3●36●46)
| answered Jan 31 '19, 4:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER You can not insert anything into anything using a REST Query. 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. |
![]()
Ralph Schoon (63.3k●3●36●46)
| answered Jan 31 '19, 5:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER 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.
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.
|
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.
Comments
I mean like a http POST or something similar