Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

ELM702: How to fetch ERM Reused Artifact count

 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.

0 votes

Comments

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



One answer

Permanent link

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

0 votes

Comments

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


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.

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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,020

Question asked: Jul 04 '23, 4:45 a.m.

Question was seen: 708 times

Last updated: Jul 21 '23, 5:55 a.m.

Confirmation Cancel Confirm