Get code coverage using REST API query

Let’s suppose you need to find all the classes or triggers starting with “MY_” and having 0 lines covered. The REST API query we need would be as follows: /services/data/v29.0/tooling/query/q=SELECT+ApexClassOrTriggerId,+ApexClassOrTrigger.Name,+NumLinesCovered,+NumLinesUncovered +FROM+ApexCodeCoverageAggregate +++WHERE+NumLinesCovered+=+0+AND+NumLinesUncovered+!=+NULL +AND+ApexClassOrTrigger.Name+like+’MY_%25’+ORDER+BY+ApexClassOrTrigger.Name Obviously, it will return a JSON string with the classes and triggers which match the criteria. There are a lot of online […]