How to use API for getting all the project keys in a text files using shell script?

I want to write a shell script to login and get all the project keys and the total lines of code in a text file.

I am using 6.7.7 LTS EE edition.



You can use api/projects/search to fetch the projects, by pages.

For the total lines of code, you could create a portfolio “All Projects”, and fetch api/measures/component with component=your portfolio key and metricKeys=ncloc

Thanks Pierre,

If i want to take only the project keys in to a xml file. Is it possible?

Not out of the box. You have to write a short script to fetch the API and work the results.