For the complete documentation index, see llms.txt. This page is also available as Markdown.

Export Productivity Metrics

Learn how to programmatically export developer, team, and org-level Productivity metrics using export APIs.

AI DLC Insights provides APIs to export Productivity metrics in CSV format for team, developer, and organization-level reporting. There are two available APIs:

  • V2 Export API (recommended): Asynchronous, scalable, and designed for large datasets and org-wide exports.

  • Legacy Reports API: Synchronous export API for team and contributor reporting use cases.

Both APIs return CSV output but differ in execution model and request structure. The V2 Export API is recommended for new integrations and large-scale exports.

The Legacy Reports API provides synchronous exports for team and contributor-level Productivity metrics.

This API is maintained for backward compatibility. Use the V2 Export API for new integrations.

Both team-level and individual-level exports use the same endpoint. The behavior depends on the parameters you include in the request body.

Endpoint: POST /v2/insights/teams/reports

Authentication: Requires an x-api-key header with an API key generated from your Harness account. For more information about generating an API key, see Manage API keys.

Exports aggregate Productivity metrics per team.

Request Body: ExportRequestDTO (see the Request body structure section below)

Response: A CSV file containing one row per team and one column per metric.

Request body structure

For ExportRequestDTO:

Field descriptions

Field
Type
Required
Description

collectionId

String

Yes

Identifier for the team of developers. If your in-app URL contains ?insightType=productivity&collectionId=6036, then the collectionId is 6036.

dateStart

Date (yyyy-MM-dd)

Yes

Start date for the report period.

dateEnd

Date (yyyy-MM-dd)

Yes

End date for the report period.

granularity

String

Yes

Time unit for rate-based metrics (daily, weekly, monthly).

teamRefId

Number

No

Team identifier. CSV will include this team and all child teams under it.

productivity

ProductivityRequestDto

No

Productivity metrics configuration.

teamRefId and collectionId refer to the same underlying team/collection identifier. Use the same value for both fields when exporting by team.

To find your collection ID in Harness AIDI, navigate to any team in the Org Tree on the Insights page, look at the page URL, and copy the value after collectionId=.

Granularity

The granularity field specifies the time unit for rate-based metrics, which measure counts over time. It affects how certain metrics are calculated and reported.

Metrics affected by granularity include the following:

  • CODING_DAYS_PER_DEV: For example, 3 coding days per week.

  • WORKTYPE_COMPLETED_PER_DEV: For example, 1.22 work items completed per week.

  • DEPLOYMENT_FREQUENCY: For example, 20 deployments per week.

Common granularity values include the following:

  • daily: Metrics calculated per day.

  • weekly: Metrics calculated per week.

  • monthly: Metrics calculated per month.

Nested objects

To configure Productivity metrics with ProductivityRequestDto:

  • metrics (required): List of productivity metric names to include in the export.

The following Productivity metrics are available:

Metric Name
Context
Unit
Description

TIME_TO_FIRST_COMMENT

Time to First Comment

Days (CSV contains numeric values without unit labels)

Measures the average time taken for the first comment to be made on a pull request. Helps track review responsiveness and team collaboration speed. Lower values indicate faster initial engagement on PRs.

PR_VELOCITY_PER_DEV

PR Velocity per Developer

Lines of code per developer per time period (affected by granularity)

Measures the average PR size (lines of code changed) per developer. Indicates developer productivity in terms of code contribution volume. Helps identify development throughput patterns.

WORKTYPE_COMPLETED_PER_DEV

Work Completed per Developer

Work items per developer per time period (affected by granularity)

Tracks bugs resolved with priority per developer. Measures developer contribution to bug resolution and issue completion. Provides insights into issue resolution capacity. Example: 1.22 means ~1.22 work items completed per week (if granularity is weekly).

CODING_DAYS_PER_DEV

Coding Days per Developer

Days per time period (affected by granularity)

Counts the number of days a developer actively contributed code. Helps track developer engagement and activity levels. Useful for understanding work patterns and availability. Example: 3 means 3 coding days per week (if granularity is weekly).

NUMBER_OF_COMMENTS_PER_PR

Number of Comments per PR

Count (dimensionless number)

Average number of review comments per pull request. Indicates code review thoroughness and collaboration intensity. Higher values may suggest more complex changes or detailed review processes.

AVG_TIME_TO_COMPLETE

Average Time to Complete

Days (CSV contains numeric values without unit labels)

Average time to complete a work item from start to finish. Measures development cycle efficiency. Helps identify bottlenecks in the development process.

Response format

Success Response (200 OK)

  • Content-Type: text/csv

  • Content-Disposition: attachment; filename="<report_name>.csv"

  • Body: CSV file with report data.

The CSV file structure contains:

  • One row per team (including child teams)

  • One column per metric

  • First row: Column headers with metric names

  • Subsequent rows: Data rows with metric values for each team

Exports productivity metrics for individual developers within a team.

Request Body: ContributorExportRequestDTO (see the Request body structure section below)

Response: A CSV file containing one row per developer and one column per metric.

Request body structure

For ContributorExportRequestDTO:

Field descriptions

Field
Type
Required
Description

collectionId

String

Yes

Identifier for the team of developers. If your in-app URL contains ?insightType=productivity&collectionId=6036, then the collectionId is 6036.

dateStart

Date (yyyy-MM-dd)

Yes

Start date for the report period.

dateEnd

Date (yyyy-MM-dd)

Yes

End date for the report period.

granularity

String

Yes

Time unit for rate-based metrics.

includeRatings

Boolean

No

Whether to include developer rating summaries.

productivityContributors

ContributorMetricsConfig

Yes

Metrics to include in the developer export.

Granularity

The granularity field specifies the time unit used to normalize rate-based team metrics, which measure counts or activity over time. Granularity determines how these metrics are aggregated and represented in the CSV output.

Team-level metrics affected by granularity include the following:

  • CODING_DAYS: For example, 3 coding days per week.

  • WORKTYPE_COMPLETED: For example, 1.22 work items completed per week.

  • DEPLOYMENT_FREQUENCY: For example, 20 deployments per week.

Common granularity values include the following:

  • daily: Metrics calculated per day.

  • weekly: Metrics calculated per week.

  • monthly: Metrics calculated per month.

Nested objects

To configure Productivity metrics with ContributorExportRequestDTO:

  • metrics (required): List of metric names to include in the export.

The following Productivity metrics are available:

Metric Name
Context
Unit
Description

PR_VELOCITY

PR Velocity

Lines of code per developer per time period (affected by granularity)

Measures average PR size (lines of code changed) per developer. Indicates code contribution throughput over time. Useful for understanding development volume across contributors.

WORK_TYPE_COMPLETED

Work Items Completed

Count per developer per time period (affected by granularity)

Number of prioritized work items completed by a contributor. Helps assess individual delivery output. Example: 2.1 means ~2.1 items/week if granularity is weekly.

CODING_DAYS

Coding Days

Days per time period (affected by granularity)

Number of days the contributor actively wrote code. Correlates with availability and engagement.

TIME_TO_FIRST_COMMENT

Time to First Comment

Days (CSV contains numeric values without units)

Time between PR creation and the first review comment. Lower values reflect faster review responsiveness.

NUMBER_OF_COMMENTS_PER_PR

Review Intensity

Count

Average number of review comments per PR. Indicates review depth or PR complexity.

AVG_TIME_TO_COMPLETE

Average Time to Complete

Days

Time from work start to completion. Higher values may indicate delays or larger tasks.

NO_OF_PRS_WITH_MISSING_TICKETS

PR Hygiene

Count

Number of pull requests missing linked work items. Useful for tracking process adherence and hygiene issues.

Contributor ratings

If you set "includeRatings": true, the CSV file includes rating columns for applicable metrics. Ratings appear only for metrics where performance tiers exist and reflect developer-specific data, not the team's aggregated value.

For example:

Collection Name
Lead Time for Changes (mean)
Lead Time for Changes Rating
Deployment Frequency
Deployment Frequency Rating
Mean Time to Restore (mean)
Mean Time to Restore Rating

Parent Team

15.53

Medium

0

45.97

Low

Response format

Success Response (200 OK)

  • Content-Type: text/csv

  • Content-Disposition: attachment; filename="<report_name>.csv"

  • Body: A CSV file with team-level report data.

The CSV file structure contains:

  • One row per collection, including: the org tree, each manager, the manager's direct reports, and individual contributors

  • One column for the collection name

  • One column per metric included in the export (for example, PR Velocity per Developer)

When the metrics array is empty, all available metrics for that category will be exported.

Harness recommends the following best practices when working with Productivity export APIs:

  • Only CSV format is currently supported.

  • All date fields must use the yyyy-MM-dd format.

  • Export responses automatically include child teams beneath the specified team scope.

  • Metric names are case-insensitive.

  • If the metrics array is empty or omitted, all available metrics for that category are exported.

  • Large exports may be automatically compressed as .gz files.

  • For large organizations, prefer team-scoped exports over root org tree exports to reduce export size and avoid timeouts.

Troubleshooting

Why does exporting Productivity metrics for the entire org sometimes time out?

Exporting Productivity metrics for the entire org from the root node can time out due to the size of large org trees (same limitation as the UI).

To avoid timeouts when exporting, export at the team or group-level instead of requesting the entire org tree at once. Optionally, split large exports into multiple, smaller team-specific API calls.

Last updated

Was this helpful?