az repos pr
Note
This reference is part of the azure-devops extension for the Azure CLI (version 2.30.0 or higher). The extension will automatically install the first time you run an az repos pr command. Learn more about extensions.
Manage pull requests.
Commands
Name | Description | Type | Status |
---|---|---|---|
az repos pr checkout |
Checkout the PR source branch locally, if no local changes are present. |
Extension | GA |
az repos pr create |
Create a pull request. |
Extension | GA |
az repos pr list |
List pull requests. |
Extension | GA |
az repos pr policy |
Manage pull request policy. |
Extension | GA |
az repos pr policy list |
List policies of a pull request. |
Extension | GA |
az repos pr policy queue |
Queue an evaluation of a policy for a pull request. |
Extension | GA |
az repos pr reviewer |
Manage pull request reviewers. |
Extension | GA |
az repos pr reviewer add |
Add one or more reviewers to a pull request. |
Extension | GA |
az repos pr reviewer list |
List reviewers of a pull request. |
Extension | GA |
az repos pr reviewer remove |
Remove one or more reviewers from a pull request. |
Extension | GA |
az repos pr set-vote |
Vote on a pull request. |
Extension | GA |
az repos pr show |
Get the details of a pull request. |
Extension | GA |
az repos pr update |
Update a pull request. |
Extension | GA |
az repos pr work-item |
Manage work items associated with pull requests. |
Extension | GA |
az repos pr work-item add |
Link one or more work items to a pull request. |
Extension | GA |
az repos pr work-item list |
List linked work items for a pull request. |
Extension | GA |
az repos pr work-item remove |
Unlink one or more work items from a pull request. |
Extension | GA |
az repos pr checkout
Checkout the PR source branch locally, if no local changes are present.
az repos pr checkout --id
[--remote-name]
Required Parameters
ID of the pull request.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Name of git remote against which PR is raised.
Property | Value |
---|---|
Default value: | origin |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az repos pr create
Create a pull request.
az repos pr create [--auto-complete {false, true}]
[--bypass-policy {false, true}]
[--bypass-policy-reason]
[--delete-source-branch {false, true}]
[--description]
[--detect {false, true}]
[--draft {false, true}]
[--labels]
[--merge-commit-message]
[--open]
[--optional-reviewers --reviewers]
[--org --organization]
[--project]
[--repository]
[--required-reviewers]
[--source-branch]
[--squash {false, true}]
[--target-branch]
[--title]
[--transition-work-items {false, true}]
[--work-items]
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Set the pull request to complete automatically when all policies have passed and the source branch can be merged into the target branch.
Property | Value |
---|---|
Default value: | False |
Accepted values: | false, true |
Bypass required policies (if any) and completes the pull request once it can be merged.
Property | Value |
---|---|
Default value: | False |
Accepted values: | false, true |
Reason for bypassing the required policies.
Delete the source branch after the pull request has been completed and merged into the target branch.
Property | Value |
---|---|
Default value: | False |
Accepted values: | false, true |
Description for the new pull request. Can include markdown. Each value sent to this arg will be a new line. For example: --description "First Line" "Second Line".
Automatically detect organization.
Property | Value |
---|---|
Accepted values: | false, true |
Use this flag to create the pull request in draft/work in progress mode.
Property | Value |
---|---|
Accepted values: | false, true |
The labels associated with the pull request. Space separated.
Message displayed when commits are merged.
Open the pull request in your web browser.
Property | Value |
---|---|
Default value: | False |
Additional users or groups to include as optional reviewers on the new pull request. Space separated.
Azure DevOps organization URL. You can configure the default organization using az devops configure -d organization=ORG_URL. Required if not configured as default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/
.
Name or ID of the project. You can configure the default project using az devops configure -d project=NAME_OR_ID. Required if not configured as default or picked up via git config.
Name or ID of the repository to create the pull request in.
Additional users or groups to include as required reviewers on the new pull request. Space separated.
Name of the source branch. Example: "dev".
Squash the commits in the source branch when merging into the target branch.
Property | Value |
---|---|
Default value: | False |
Accepted values: | false, true |
Name of the target branch. If not specified, defaults to the default branch of the target repository.
Title for the new pull request.
Transition any work items linked to the pull request into the next logical state. (e.g. Active -> Resolved).
Property | Value |
---|---|
Default value: | False |
Accepted values: | false, true |
IDs of the work items to link to the new pull request. Space separated.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az repos pr list
List pull requests.
az repos pr list [--creator]
[--detect {false, true}]
[--include-links]
[--org --organization]
[--project]
[--repository]
[--reviewer]
[--skip]
[--source-branch]
[--status {abandoned, active, all, completed}]
[--target-branch]
[--top]
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Limit results to pull requests created by this user.
Automatically detect organization.
Property | Value |
---|---|
Accepted values: | false, true |
Include _links for each pull request.
Property | Value |
---|---|
Default value: | False |
Azure DevOps organization URL. You can configure the default organization using az devops configure -d organization=ORG_URL. Required if not configured as default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/
.
Name or ID of the project. You can configure the default project using az devops configure -d project=NAME_OR_ID. Required if not configured as default or picked up via git config.
Name or ID of the repository.
Limit results to pull requests where this user is a reviewer.
Number of pull requests to skip.
Limit results to pull requests that originate from this source branch.
Limit results to pull requests with this status.
Property | Value |
---|---|
Accepted values: | abandoned, active, all, completed |
Limit results to pull requests that target this branch.
Maximum number of pull requests to list.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az repos pr set-vote
Vote on a pull request.
az repos pr set-vote --id
--vote {approve, approve-with-suggestions, reject, reset, wait-for-author}
[--detect {false, true}]
[--org --organization]
Required Parameters
ID of the pull request.
New vote value for the pull request.
Property | Value |
---|---|
Accepted values: | approve, approve-with-suggestions, reject, reset, wait-for-author |
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Automatically detect organization.
Property | Value |
---|---|
Accepted values: | false, true |
Azure DevOps organization URL. You can configure the default organization using az devops configure -d organization=ORG_URL. Required if not configured as default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/
.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az repos pr show
Get the details of a pull request.
az repos pr show --id
[--detect {false, true}]
[--open]
[--org --organization]
Required Parameters
ID of the pull request.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Automatically detect organization.
Property | Value |
---|---|
Accepted values: | false, true |
Open the pull request in your web browser.
Property | Value |
---|---|
Default value: | False |
Azure DevOps organization URL. You can configure the default organization using az devops configure -d organization=ORG_URL. Required if not configured as default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/
.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az repos pr update
Update a pull request.
az repos pr update --id
[--auto-complete {false, true}]
[--bypass-policy {false, true}]
[--bypass-policy-reason]
[--delete-source-branch {false, true}]
[--description]
[--detect {false, true}]
[--draft {false, true}]
[--merge-commit-message]
[--org --organization]
[--squash {false, true}]
[--status {abandoned, active, completed}]
[--title]
[--transition-work-items {false, true}]
Required Parameters
ID of the pull request.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Set the pull request to complete automatically when all policies have passed and the source branch can be merged into the target branch.
Property | Value |
---|---|
Accepted values: | false, true |
Bypass required policies (if any) and completes the pull request once it can be merged.
Property | Value |
---|---|
Accepted values: | false, true |
Reason for bypassing the required policies.
Delete the source branch after the pull request has been completed and merged into the target branch.
Property | Value |
---|---|
Accepted values: | false, true |
New description for the pull request. Can include markdown. Each value sent to this arg will be a new line. For example: --description "First Line" "Second Line".
Automatically detect organization.
Property | Value |
---|---|
Accepted values: | false, true |
Publish the PR or convert to draft mode.
Property | Value |
---|---|
Accepted values: | false, true |
Message displayed when commits are merged.
Azure DevOps organization URL. You can configure the default organization using az devops configure -d organization=ORG_URL. Required if not configured as default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/
.
Squash the commits in the source branch when merging into the target branch.
Property | Value |
---|---|
Accepted values: | false, true |
Set the new state of pull request.
Property | Value |
---|---|
Accepted values: | abandoned, active, completed |
New title for the pull request.
Transition any work items linked to the pull request into the next logical state. (e.g. Active -> Resolved).
Property | Value |
---|---|
Accepted values: | false, true |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |