Dataset: Issues & Pull Requests
Entity: Pull Requests
Field ID: required_approval_remaining_count
Type: Integer
Description: The number of approvals still required before the pull request can be considered approved. For issues, the value is calculated from resolving pull requests.
Source: Calculated
Transformation logic: Number of required approvals - number of approvals received.
Pull Requests: calculate
required_approval_count - approval_count(minimum is0).Issues: sum the required approvals remaining of all resolving pull requests. Resolving pull requests are pull requests that reference the issue via auto-closing keywords.
From: |
|
Github (PRs, Issues) | Calculated |
Gitlab (PRs, Issues) | Calculated |
Bitbucket (PRs) | Calculated |
Azure DevOps (PRs, Issues) | Calculated Required and optional reviewers both participate in the calculation. |
JIRA (Issues) | Inferred from resolving PRs |
ClickUp (Issues) | Inferred from resolving PRs |
Trello (Issues) | Inferred from resolving PRs |
Reporting Use Cases
The Required Approvals Remaining field is a dynamic counter that provides a real-time status of a pull request's approval progress. It is one of the most important fields for creating actionable workflows, managing review queues, and auditing compliance.
Filtering for Workflow Management: This field's primary use is to segment pull requests into clear, actionable states.
"Ready to Merge" Queue: You can create a report of all pull requests that have met their approval criteria by using a filter where
Required Approvals Remaining = 0. When combined with a filter for a successful build status, this creates a definitive list of items ready for deployment."Needs Review" Queue: Conversely, a filter where
Required Approvals Remaining > 0will show all pull requests that are still pending one or more reviews. This is perfect for building a "To Review" list for your team.
Reporting on Pipeline Health: You can get a high-level overview of your review pipeline's health by categorizing PRs based on this field.
A pie chart with a custom dimension like
IF(required_approval_remaining_count == 0, "Approved", "Pending Review")and aCOUNT()metric can instantly visualize the proportion of your open pull requests that are approved versus those still in the review cycle.
Creating Advanced Compliance Metrics: This field is a key component in calculating your team's adherence to your review policies.
PR Review Ratio: The percentage of required approvals that were met on merged PRs can be calculated with a custom formula:
ROUND(AVG(IF(required_approval_count == 0, 1, (required_approval_count - required_approval_remaining_count) / required_approval_count)), 2) * 100. A score below 100% indicates that pull requests are being merged without meeting the minimum review requirements.
