RM API - create implemented By link
I want to link an dng-artifact to a work item of ewm.
I have found following question: https://jazz.net/forum/questions/271787/rm-api-create-validate-by-link-using-rmdatacreatelink
Based on this I tried to create a new artifact ref for the work item:
let targetLink="https://example/ccm/oslc/workitems/12345"
targetLink= new RM.ArtifactRef(targetLink)
And then tried to create the link.
RM.Data.createLink(artRefsList[0][0], RM.Constants.IMPLEMENTED_BY, targetLink, function(cb){
console.log (cb)
})
artRefsList[0][0] is typeOf object and is used in previous function to get Attributes: RM.Data.getAttributes(
artRefsList[0][0].... and worked fine..
The error I receive by doing this: TypeError: Cannot read properties of undefined (reading 'IMPLEMENTED_BY').
Is there a way to solve this problem?
Is there another way to create a link between an artifact in Doors next in module context to a work item in EWM? I only found an article with no reference of module context: https://jazz.net/library/article/1197
|
2 answers
You have the reference wrong - it should be RM.Data.LinkTypes.IMPLEMENTED_BY
This is the reference to the API if you haven't already discovered it:
|
Thank you for your hints.
First I tried to change the RM.Data.createLink as described by Davyd:
RM.Data.createLink(artRefsList[0][0], RM.Data.LinkTypes.IMPLEMENTED_BY, targetLink, function(cb){
console.log (cb)
})
But the result was:
RM.OperationResult
code: "OPERATION_FAILED"
message: "You cannot create ELM links in this version of the API: [object Object]"
So my next trial was the official OSLC API and how the tool works as mentioned by Ralph. My code does now looks like:
(strange think by doing this: It works only, if the url looks like this. The characters %2F has to used instead of "/") Comments 1
This is called URL Encoding. You can not have certain characters used in certain areas of an URL. Why do the URL's look like https://example/rm/proxy? This is unusual.
Antje Rößle-Tuchel
commented Jul 23, 4:08 a.m.
I have got it from the tool handling. But you are right: GEThttps://example/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/39572
works also.
Ian Barnard
commented Jul 23, 5:52 a.m.
| edited Jul 23, 5:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
This path /rm/linksCache is not a public OSLC API. You shouldn't use it.
You should not use /rm/proxy either.
The OSLC Way to add a link from a work item to a requirement is to first GET the WI using EWM OSLC API (you already have its EWM URL don't you), update the rdf with the link and PUT the updated rdf to EWM to update the WI.
If you're not sure how to modify the rdf to add a link, look at an example of an existing link on a WI.
Antje Rößle-Tuchel
commented Jul 24, 7:42 a.m.
What can I do alternatively to /rm/linksCache?
Only linking in EWM is not enough. I am doing this first at all. The link has additionally to be created to the artifact in ERM himself. If I do not do this, the link is not visible in ERM. We are working with change sets.
You would use the OSLC API. As an example https://rsjazz.wordpress.com/2022/02/02/ewm-work-item-oslc-cm-api/ Unfortunately I have not created an example for creating links. ERM is not storing the links. ERM has also an OSLC API.
showing 5 of 6
show 1 more comments
|
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
sorry the targeLink looks of cause like this:
I can not answer the first part of the question. I have no experience with that API. As far as I know there are the following other APIs that could create links between work items and requirements:
Unfortunately the OSLC Workshop is quite old.
Here might be a better maintained one: https://oslc.github.io/developing-oslc-applications/ . There are some youtube videos as well.
I published https://rsjazz.wordpress.com/2022/02/02/ewm-work-item-oslc-cm-api/ which covers all EWM rest APIs (OSLC and Reportable Rest) as well as authentication.
It would be a good idea to create the links in the tool and then get the RDF+XML representation for both ends. To look how they are changed.