It's all about the answers!

Ask a question

ELM702: How to fetch ERM Reused Artifact count


Vidhubala Sankarakumar (131) | asked Jul 04 '23, 4:45 a.m.

 Hi Team,

We are using ELM702 version and required to gather the Total Number of Reused Artifacts and Total Number of Times Artifacts Reused. 

The artifacts created using below process,
To reuse artifacts in a module, we can add existing artifacts to a module or create new artifacts in the module. We can also reuse an artifact by copying it from one module and pasting to another module. You can also select and insert an existing artifact from another module into a module. The base artifact is reused and added to the module.

Please refer below link for more details:

I have followed the steps mentioned in the following page https://jazz.net/wiki/bin/view/Main/DNGModuleApiScenario2 

https://<publicuri>/rm/resources/<Moduleid>/structure
Headers:
Acceptapplication/json
DoorsRP-Request-Typepublic 2.0

Got the below response:
[
 {
  "uri": "https://<publicuri>/rm/resources/MD_QUiKoBQBEe64KdLUVArWXQ/structure",
  "type": "dng_module:Binding",
  "component": "https://<publicuri>/rm/cm/component/_xh0YEIXQEeyqUuM828MKQg",
  "isStructureRoot": "true",
  "isHeading": false,
  "module": "https://<publicuri>/rm/resources/MD_QUiKoBQBEe64KdLUVArWXQ",
  "childBindings": [
   "https://<publicuri>/rm/resources/BI_SWk64BQBEe64KdLUVArWXQ",
   "https://<publicuri>/rm/resources/BI_dIK1MBQBEe64KdLUVArWXQ"
  ]
 },
 {
  "uri": "https://<publicuri>/rm/resources/BI_SWk64BQBEe64KdLUVArWXQ",
  "type": "dng_module:Binding",
  "component": "https://<publicuri>/rm/cm/component/_xh0YEIXQEeyqUuM828MKQg",
  "isHeading": false,
  "module": "https://<publicuri>/rm/resources/MD_QUiKoBQBEe64KdLUVArWXQ",
  "boundArtifact": "https://<publicuri>/rm/resources/TX_HlmYUIXREeyqUuM828MKQg",
  "childBindings": []
 },
 {
  "uri": "https://<publicuri>/rm/resources/BI_dIK1MBQBEe64KdLUVArWXQ",
  "type": "dng_module:Binding",
  "component": "https://<publicuri>/rm/cm/component/_xh0YEIXQEeyqUuM828MKQg",
  "isHeading": false,
  "module": "https://<publicuri>/rm/resources/MD_QUiKoBQBEe64KdLUVArWXQ",
  "boundArtifact": "https://<publicuri>/rm/resources/TX_dIXpgBQBEe64KdLUVArWXQ",
  "childBindings": []
 }
]

When i further requested for the artifact detail, didn't find difference between the response of reused artifact and original/base artifact. Please suggest how can i find reused artifact from the response? It will helps to gather the total reused artifact count.

API call to get artifact detail:
URI: https://<publicuri>/rm/resources/BI_SWk64BQBEe64KdLUVArWXQ

Thanks.


Comments
Ian Barnard commented Jul 04 '23, 12:18 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The DN Reportable REST API is primarily intended for extracting data for reporting, rather than to calculate metrics.

One answer



permanent link
Ian Barnard (2.1k613) | answered Jul 04 '23, 11:54 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jul 04 '23, 11:59 a.m.

With OSLC Query you can query for artifacts and in the results differentiate between core artifacts (which have a rm_nav:parent property) and module bindings (i.e. reuses) (which don't have rm_nav:parent), also retreiving the identifier. Then postprocessing the results you can count the reuses of the core artifacts by matching the identifier of a binding to the identifier of a core artifact.



HTH
Ian


Comments
Vidhubala Sankarakumar commented Jul 20 '23, 8:01 a.m.

Hi Ian,

Thanks for your inputs. I have tried the GET method call for the below URL

I am getting nav parent tag in the reponse which is pointing to folder url.

I'm not able to find the reused artifacts from this. Can you please suggest how can i get the resused artifacts. Also, I have referred the mentioned link  https://jazz.net/library/article/1197

Thanks,
Vidhubala



Ian Barnard commented Jul 20 '23, 1:42 p.m. | edited Jul 21 '23, 5:55 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

a) That's not an OSLC Query which is what I suggested, which could simply give you all core and binding artifacts you can count and differentiate them as per my answer.

And b) if you want to get the module contents use the Module  API https://jazz.net/wiki/bin/view/Main/DNGModuleApiOverview - but note that's on a module-by-module basis so you'll still need to use OSLC Query to find all the modules. See [OSLC] How to query the hierarchy of requirements within a module - Jazz Forum for more detail of using the module API - note in particular in my answer the headers to provide/not provide to access the module API, because it is quite fussy.


Ian Barnard commented Jul 20 '23, 1:48 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

FYI There's a walkthrough of discovering the OSLC Query Capability urls here https://jazz.net/forum/questions/266334/dng-oslcfetch-components-from-project-area - note you mustn't hardcode these because that's fragile across ELM versions.

Your answer


Register or 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.