ApexCodeCoverageAggregate

Represents aggregate code coverage test results for an Apex class or trigger.

Version 

Introduced in API version 29.0.

Supported SOAP API Calls 

delete(), describeSObjects(), query(), retrieve(), update()

Supported REST API Methods 

DELETE, GET, HEAD, PATCH, Query

Special Access Rules 

  • In API version 49.0 and later, users must have the View Setup and Configuration permission to access this object.

Fields 

ApexClassOrTriggerId 

  • Type: reference

  • Required: No

  • Properties: Filter, Group, Sort, Update

  • Relationship name: ApexClassOrTrigger

  • Relationship type: polymorphic

  • Refers to: ApexClass, ApexTrigger

Coverage 

  • Type: complexvalue

  • Required: No

  • Properties: Nillable

  • Description: Two lists of integers. The first is the covered lines, and the second is the list of uncovered lines. If a line is missing from both lists, the line isn’t executable and doesn’t require coverage.

Coverage includes the following fields:

  • coveredLines
  • namespace
  • uncoveredLines

CoverageLastModifiedDate 

  • Type: datetime
  • Required: No
  • Properties: Filter, Nillable, Sort, Update

NumLinesCovered 

  • Type: int

  • Required: No

  • Properties: Filter, Group, Nillable, Sort, Update

  • Description: The number of covered lines.

NumLinesUncovered 

  • Type: int

  • Required: No

  • Properties: Filter, Group, Nillable, Sort, Update

  • Description: The number of uncovered lines.

Usage 

To query for aggregate code coverage, specify an Apex test class. The returned JSON or XML object will contain two lists of integers: one for covered and one for uncovered lines. For examples, see ApexCodeCoverage.

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!