Skip to main content

Pull Request Metrics

Pull request metrics provide insights into the volume, size, productivity, and interactions of pull requests in your repositories.

Available Metrics

string
Number of pull requests
string
Size of pull requests (additions + deletions)
string
Percentage of PRs that received at least one review
string
Code complexity score of pull requests
string
Number of unique contributors
string
Number of reviews submitted
string
Number of review interactions
string
Number of review rounds per PR
string
Average number of reviewers per PR
string
Number of distinct reviewers in the period
string
Rate of reviews that requested changes
string
Comment interaction count
string
Number of comments
string
Average number of comments per PR
string
Commit interaction count
string
Number of commits

Pull Requests Count Metric

This endpoint provides the count of pull requests based on specified filters.

Pull Requests Size Metric

This endpoint provides information about the size of pull requests.

Complexity Score Metric

This endpoint provides the complexity score of pull requests, which measures code complexity introduced per PR.

Parameter Notes

string
For pull request metrics, the following date fields are available:
  • created_at: When the PR was created
  • merged_at: When the PR was merged
  • closed_at: When the PR was closed
string
Required for non-count metrics. Accepted values: SUM, MAX, MIN, AVG. Count-based metrics (pull-requests-count, reviews-count, comments-count, commits-count, review-interactions-count, comment-interactions-count, commit-interactions-count, review-rounds, active-reviewers, reviewers-per-pr, review-rate, changes-requested-rate, comments-per-pr, contributors-count) do not require an aggregation.
object
Applicable filters for pull request metrics:
  • repositories: Array of {"repository_name": "..."} objects
  • member: Filter by author merged user IDs
  • team: Filter by team IDs
  • squad_ids: Filter by squad IDs
  • squad_levels: Filter by squad hierarchy level
  • manager_ids: Filter by manager user IDs
  • departments: Filter by department names
  • pr_states: PR states — open, closed, merged
  • pr_categories: PR category classifications
  • pr_ids: Filter by specific PR IDs
  • sources: VCS source — github, gitlab, bitbucket
  • pull_requests_search_term: Full-text search across PR title, description, body, summary, and category
  • locations: Filter by employee location
  • levels: Filter by employee level
  • review_hour_of_day: Filter reviews by hour of day (0–23) — for reviews-by-time-of-day
  • review_rounds_bucket: Filter by review rounds bucket — for review-rounds

Common Use Cases

  • Monitor PR Volume: Track the number of PRs created over time
  • Identify Large PRs: Find PRs that are above a certain size threshold using metric_min_value
  • Analyze Review Culture: Track review rate and comments per PR
  • Assess productivity Trends: Monitor if code productivity is increasing or decreasing over time
  • Team Comparison: Compare PR metrics across different teams or repositories