It's all about the answers!

Ask a question

How to extract a count of the number of Components in the repository

nannette Mori (50464) | asked Sep 30 '16, 4:50 p.m.
We need to provide a count of the number of components in the repository.  Is there a way to extract this information from RTC

One answer

permanent link
Alan Sampson (93749) | answered Oct 02 '16, 12:40 a.m.
edited Oct 02 '16, 9:50 p.m.
A quick and dirty way to do this would be with the SCM command line interface:

lscm login -r -n JU -u jazz_user -c
Password (jazz_user @
Logged in to

lscm list components -r JU --all
(1015) "Scrum001 Default Component"
(1016) "Scrum002 Default Component"

Capture the output to a file and count the results or pipe it into a program like wc and have it count the lines for you (untested but I don't see why it wouldn't work):

lscm list components -r JU --all | wc -l

Or if you prefer you can write the output as JSON:

lscm list components -r JU --all --json
    "components": [
            "name": "Scrum001 Default Component",
            "url": "https:\/\/\/ccm\/",
            "uuid": "_4BSP0AXMEeaNrsV1PND6zw"

From there it's just a "simple matter of programming" to parse the JSON and count the components.

See for the CLI scm list components command syntax.

Your answer

Register or to post your answer.