Azure DevOps · Schema

GitPullRequest

An Azure DevOps Git pull request

AgileCI/CDDevOpsProject ManagementVersion Control

Properties

Name Type Description
pullRequestId integer Unique numeric ID of the pull request
title string Title of the pull request
description string Description of the changes in this pull request
status string Current status of the pull request
createdBy object
creationDate string Date and time the pull request was created
closedDate string Date and time the pull request was completed or abandoned
targetRefName string Target branch for the merge
sourceRefName string Source branch containing the changes
mergeId string ID of the merge operation
mergeStatus string Current merge status
lastMergeSourceCommit object Latest commit in the source branch
lastMergeTargetCommit object Latest commit in the target branch
lastMergeCommit object The merge commit (if the PR has been merged)
reviewers array Reviewers assigned to this pull request
url string
repository object
isDraft boolean Whether this is a draft pull request
autoCompleteSetBy object
completionOptions object Options for auto-completing the PR
workItemRefs array Work items associated with this pull request
labels array Labels attached to this pull request
_links object
View JSON Schema on GitHub

JSON Schema

microsoft-azure-devops-gitpullrequest-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/GitPullRequest",
  "title": "GitPullRequest",
  "type": "object",
  "description": "An Azure DevOps Git pull request",
  "properties": {
    "pullRequestId": {
      "type": "integer",
      "description": "Unique numeric ID of the pull request",
      "example": 42
    },
    "title": {
      "type": "string",
      "description": "Title of the pull request",
      "example": "Add new login feature"
    },
    "description": {
      "type": "string",
      "description": "Description of the changes in this pull request"
    },
    "status": {
      "type": "string",
      "description": "Current status of the pull request",
      "enum": [
        "notSet",
        "active",
        "abandoned",
        "completed",
        "all"
      ]
    },
    "createdBy": {
      "$ref": "#/components/schemas/IdentityRef"
    },
    "creationDate": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time the pull request was created"
    },
    "closedDate": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time the pull request was completed or abandoned"
    },
    "targetRefName": {
      "type": "string",
      "description": "Target branch for the merge",
      "example": "refs/heads/main"
    },
    "sourceRefName": {
      "type": "string",
      "description": "Source branch containing the changes",
      "example": "refs/heads/feature/login"
    },
    "mergeId": {
      "type": "string",
      "format": "uuid",
      "description": "ID of the merge operation"
    },
    "mergeStatus": {
      "type": "string",
      "description": "Current merge status",
      "enum": [
        "notSet",
        "queued",
        "conflicts",
        "succeeded",
        "rejectedByPolicy",
        "failure"
      ]
    },
    "lastMergeSourceCommit": {
      "type": "object",
      "description": "Latest commit in the source branch",
      "properties": {
        "commitId": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "lastMergeTargetCommit": {
      "type": "object",
      "description": "Latest commit in the target branch",
      "properties": {
        "commitId": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "lastMergeCommit": {
      "type": "object",
      "description": "The merge commit (if the PR has been merged)",
      "properties": {
        "commitId": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "reviewers": {
      "type": "array",
      "description": "Reviewers assigned to this pull request",
      "items": {
        "$ref": "#/components/schemas/IdentityRefWithVote"
      }
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "repository": {
      "$ref": "#/components/schemas/GitRepository"
    },
    "isDraft": {
      "type": "boolean",
      "description": "Whether this is a draft pull request"
    },
    "autoCompleteSetBy": {
      "$ref": "#/components/schemas/IdentityRef"
    },
    "completionOptions": {
      "type": "object",
      "description": "Options for auto-completing the PR",
      "properties": {
        "deleteSourceBranch": {
          "type": "boolean"
        },
        "squashMerge": {
          "type": "boolean"
        },
        "mergeStrategy": {
          "type": "string",
          "enum": [
            "noFastForward",
            "squash",
            "rebase",
            "rebaseMerge"
          ]
        },
        "transitionWorkItems": {
          "type": "boolean"
        }
      }
    },
    "workItemRefs": {
      "type": "array",
      "description": "Work items associated with this pull request",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    },
    "labels": {
      "type": "array",
      "description": "Labels attached to this pull request",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          }
        }
      }
    },
    "_links": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "href": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  }
}