How to get linked artifacts from another artifact using DNG API for 7.0.2 version
Hi Team,
How to get linked artifacts from another artifact using DNG API for 7.0.2 version.
I tried below request
https://ibmalm.com/rm/links?sourceOrTarget=https://ibmalm.com/rm/resources/JY_6i9-aNbHHgys9grfYrRJ7A
but getting below response
Error 403: Forbidden CRRRS4142E getInternalRequestHandlerService(context) returned null. This error used to report 'The requested service requires a private header'.
Can you please anyone suggest for 7.0.2 version.
Requirements Management/7.0.2 |
2 answers
Ian Barnard (2.3k●6●13)
| answered Jul 06 '22, 7:53 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Private APIs are subject to change, as you've discovered.
Let's look at some approaches using public APIs.
You can use OSLC Query to find artifacts (using e.g. the artifact type or perhaps identifier(s) you're interested in) - and include the Satisfies link in the results by specifying it in the oslc.select parameter. For example this query for a specific identifier 3914 with oslc.select including the component-specific Satisfies link:
GET /rm/views?oslc.pageSize=200&oslc.paging=true&oslc.prefix=dcterms%3D%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%2Crp0%3D%3Chttps%3A%2F%2Fjazz.ibm.com%3A9443%2Frm%2Ftypes%2F%3E%2Crm_nav%3D%3Chttp%3A%2F%2Fjazz.net%2Fns%2Frm%2Fnavigation%23%3E&oslc.query=true&oslc.select=rp0%3A_OAAJadcLEeqXpuBdEolY7w%2Cdcterms%3Aidentifier%2Crm_nav%3Aparent&oslc.where=dcterms%3Aidentifier%3D3914&projectURL=https%3A%2F%2Fjazz.ibm.com%3A9443%2Frm%2Fprocess%2Fproject-areas%2F_NDNJ0NcLEeqXpuBdEolY7w HTTP/1.1
headers:
returns results including the target of the link, in this this outgoing link is from a module reuse of the artifact id 3914 so there are two results. The core artifact result includes rm_nav:parent, the module reuse of it doesn't:
<rdf:RDF xmlns:rrmNav="http://com.ibm.rdm/navigation#"
xmlns:jazz_rm="http://jazz.net/ns/rm#"
xmlns:nav="http://jazz.net/ns/rm/navigation#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_rm="http://open-services.net/ns/rm#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:rt="https://jazz.ibm.com:9443/rm/types/"
>
<dcterms:title>Query Results: 2</dcterms:title>
</oslc:ResponseInfo>
<rdf:Description rdf:about="https://jazz.ibm.com:9443/rm/views?oslc.query=true&projectURL=https%3A%2F%2Fjazz.ibm.com%3A9443%2Frm%2Fprocess%2Fproject-areas%2F_NDNJ0NcLEeqXpuBdEolY7w">
<rdfs:member>
<oslc_rm:Requirement rdf:about="https://jazz.ibm.com:9443/rm/resources/_OBCrbtcLEeqXpuBdEolY7w">
<nav:parent rdf:resource="https://jazz.ibm.com:9443/rm/folders/_OAAJVtcLEeqXpuBdEolY7w"/>
<dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">3914</dcterms:identifier>
</oslc_rm:Requirement>
</rdfs:member>
<rdfs:member>
<oslc_rm:Requirement rdf:about="https://jazz.ibm.com:9443/rm/resources/_OA46KtcLEeqXpuBdEolY7w">
<rt:_OAAJadcLEeqXpuBdEolY7w rdf:resource="https://jazz.ibm.com:9443/rm/resources/_OAvwUdcLEeqXpuBdEolY7w"/>
<dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">3914</dcterms:identifier>
</oslc_rm:Requirement>
</rdfs:member>
</rdf:Description>
</rdf:RDF>.
Or if you have the URI of an artifact then an OSLC GET on that contains outgoing links looking like this:
headers:
result:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:acp="http://jazz.net/ns/acp#" xmlns:public_rm_10="http://www.ibm.com/xmlns/rm/public/1.0/" xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/" xmlns:jazz_rm="http://jazz.net/ns/rm#" xmlns:acc="http://open-services.net/ns/core/acc#" xmlns:process="http://jazz.net/ns/process#" xmlns:rm_property="https://jazz.ibm.com:9443/rm/types/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oslc="http://open-services.net/ns/core#" xmlns:nav="http://jazz.net/ns/rm/navigation#" xmlns:oslc_config="http://open-services.net/ns/config#" xmlns:oslc_rm="http://open-services.net/ns/rm#" xmlns:dng_task="http://jazz.net/ns/rm/dng/task#" xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/" xmlns:oslc_auto="http://open-services.net/ns/auto#">
<rdf:Description rdf:about="https://jazz.ibm.com:9443/rm/resources/_OA46KtcLEeqXpuBdEolY7w">
<rdf:type rdf:resource="http://jazz.net/ns/rm#Text"/>
<oslc:serviceProvider rdf:resource="https://jazz.ibm.com:9443/rm/oslc_rm/_NDNJ0NcLEeqXpuBdEolY7w/services.xml"/>
<oslc_config:component rdf:resource="https://jazz.ibm.com:9443/rm/cm/component/_NMJDYNcLEeqXpuBdEolY7w"/>
<dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">3914</dcterms:identifier>
<dcterms:title rdf:parseType="Literal">Information captured via the handheld device shall be downloadable via either cable hookup or wireless signal.</dcterms:title>
<jazz_rm:primaryText rdf:parseType="Literal"><div xmlns="http://www.w3.org/1999/xhtml">
<div> <p id="_20"> <span style="font-family: arial,sans-serif; font-size: 10.0pt; ">Information captured via the handheld device shall be downloadable via either cable hookup or wireless signal.</span></p></div>
</div></jazz_rm:primaryText>
<rm_property:_OAJ6W9cLEeqXpuBdEolY7w rdf:resource="https://jazz.ibm.com:9443/rm/types/_OBCradcLEeqXpuBdEolY7w#_OBCratcLEeqXpuBdEolY7w"/>
<dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-08-05T11:03:26.72Z</dcterms:modified>
<rdf:type rdf:resource="http://open-services.net/ns/rm#Requirement"/>
<rm_property:_OAJ6YdcLEeqXpuBdEolY7w rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</rm_property:_OAJ6YdcLEeqXpuBdEolY7w>
<dcterms:creator rdf:resource="https://jazz.ibm.com:9443/jts/users/ibm"/>
<acp:accessControl rdf:resource="https://jazz.ibm.com:9443/rm/accessControl/_NDNJ0NcLEeqXpuBdEolY7w"/>
<oslc:instanceShape rdf:resource="https://jazz.ibm.com:9443/rm/types/_OA46e9cLEeqXpuBdEolY7w"/>
<rm_property:_OAAJadcLEeqXpuBdEolY7w rdf:resource="https://jazz.ibm.com:9443/rm/resources/_OAvwUdcLEeqXpuBdEolY7w"/>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-08-05T11:03:26.72Z</dcterms:created>
<rm_property:_OAJ6XNcLEeqXpuBdEolY7w rdf:resource="https://jazz.ibm.com:9443/rm/types/_OBCrVNcLEeqXpuBdEolY7w#_OBCrWtcLEeqXpuBdEolY7w"/>
<process:projectArea rdf:resource="https://jazz.ibm.com:9443/rm/process/project-areas/_NDNJ0NcLEeqXpuBdEolY7w"/>
<dcterms:contributor rdf:resource="https://jazz.ibm.com:9443/jts/users/ibm"/>
</rdf:Description>
<rdf:Description rdf:nodeID="A0">
<rdf:subject rdf:resource="https://jazz.ibm.com:9443/rm/resources/_OA46KtcLEeqXpuBdEolY7w"/>
<rdf:predicate rdf:resource="https://jazz.ibm.com:9443/rm/types/_OAAJadcLEeqXpuBdEolY7w"/>
<rdf:object rdf:resource="https://jazz.ibm.com:9443/rm/resources/_OAvwUdcLEeqXpuBdEolY7w"/>
<rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/>
<dcterms:title>1378</dcterms:title>
</rdf:Description>
</rdf:RDF>
Another approach using a public API which should give outgoing link information is the DN Reportable REST API see https://jazz.net/wiki/bin/view/Main/DNGReportableRestAPI - sorry don't have an example of this.
HTH
Ian
Comments
CLM _User
commented Jul 06 '22, 12:49 p.m.
Thanks Ian for guidance and ways you suggested, I will try with public APIs and will come back with updates. |
Ralph Schoon (63.5k●3●36●46)
| answered Jul 06 '22, 4:57 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER As I already mentioned in my comment the API you use is an internal API. Internal APIS must only be used by the tool itself. Just because it worked in 6.0.6, does not mean anything for newer versions. Since it is an internal API nothing is documented in a way that it is accessible to the users. So it might have worked in 6.x the way you use it and they added a requirement for a private header.
See https://jazz.net/forum/questions/171394/get-all-rm-artifacts-that-have-links-of-any-type-specific-type which mentions that it is private. I do not know what private header is missing.
There are mentions of a private header in some forum questions here.
I do not have the time and liberty to debug internal APIs and can not help here.
|
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
For all I can tell, that is not an OSLC API. The error message indicates it is an internal API.
Thanks Ralph, I corrected it, can please help me what going wrong here, same API working for 6.0.6 version.