Lesstep
Azure DevOps Services and Server · Pull requests · November 1, 2026

Change the target branch, title or description of an Azure DevOps pull request

A pull request opened against the wrong branch does not have to be abandoned and opened again: the target branch of an active pull request can be changed, and so can its title and description. Below is where each one is on the web page, what the Azure CLI and the REST API can do, and two limits that catch scripts, from Microsoft's Create pull requests and Pull Requests - Update.

Change the target branch

On the pull request's Overview page, select More actions at the upper right and choose Change target branch. In the Change target branch pane, select Choose a target branch, pick the new branch and select Change.

Before a new pull request is saved, there is also a Switch source and target branches icon next to the branch names. It goes away once the pull request is active; Change target branch is the way after that.

The Azure CLI cannot do this. az repos pr create takes --target-branch, but az repos pr update has no option for it (its options include --title, --description, --status and --draft). With the REST API, send the new branch as targetRefName; Microsoft lists it among the properties a PATCH can change "when the PR retargeting feature is enabled".

PATCH https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repository}/pullrequests/21?api-version=7.1
{"targetRefName": "refs/heads/release/2.4"}

Change the title and description

On the web page, select the current title, change the text and select the Save icon (or the Undo icon to drop the change). For the description, select the Edit icon in the Description section. The description is Markdown.

On Azure DevOps Services, the CLI changes both (it does not support Azure DevOps Server). Each value given to --description becomes a new line.

az repos pr update --id 21 --title "Retry the upload once" --description "Retries a failed upload once." "The second failure is reported as before."

With the REST API, on Services and on your own server, PATCH the pull request with title and description. The token needs Code (Read & write). On a server, use the newest api-version it knows: 7.0 on Azure DevOps Server 2022, 6.0 on 2020, 5.0 on 2019 and 4.1 on TFS 2018 (what a server answers to a newer one).

PATCH .../pullrequests/21?api-version=7.1
{"title": "Retry the upload once", "description": "Retries a failed upload once.\nThe second failure is reported as before."}

Two limits that catch scripts

A description holds up to 4,000 characters. Microsoft's Update page gives that number, and tools that generate long descriptions cut theirs to fit: Dependabot counts in UTF-16, where most emoji take two of the 4,000.

The list call cuts descriptions short. Microsoft's Get Pull Requests page notes that the description field "will be truncated up to 400 symbols" in its result. A script that lists pull requests, changes a description and sends it back saves the cut text, and the rest of the description is gone. Read the one pull request first (GET .../pullrequests/21), then edit what it returns.

Editing in IntelliJ IDEA and Rider

Azure DevOps Pull Requests, a plugin by Lesstep for JetBrains IDEs 2024.1 or later and Android Studio, lists the pull requests of Azure DevOps Services and Azure DevOps Server in an IDE tool window. Edit title and description on an open pull request opens both in one dialog and saves them as the web page does. It reads the pull request again before the dialog opens, so a description longer than 400 characters is edited whole, not the shortened copy from the list. It is a paid feature with a 30-day free trial; reading stays free. Change the target branch in the browser.

Get it on JetBrains Marketplace

Azure DevOps is a trademark of Microsoft Corporation; IntelliJ IDEA and Rider are trademarks of JetBrains s.r.o. This page is not affiliated with or endorsed by Microsoft or JetBrains.

More: abandon and reactivate · pull request templates · az repos pr · merge conflicts · 日本語