Actions34
- Git Repositories Actions
- Pipelines (CI/CD) Actions
- Work Items (Boards) Actions
- Pull Requests Actions
- Test Plans (QA) Actions
- Service Hooks (Webhooks) Actions
- Wiki Actions
- Artifacts Actions
- Boards & Iterations Actions
Pull Requests → Create
AI-generatedSummary
Creates a pull request in an Azure DevOps Git repository from a source branch to a target branch, with optional description, draft flag, reviewers and linked work items. Returns the created pull request object from the Azure DevOps API.
Inputs
- project (required) — Azure DevOps project name or ID that contains the repository.
- repositoryId (required) — Repository ID or name in which to create the pull request.
- sourceRefName (required) — Source branch full ref, e.g. refs/heads/my-feature.
- targetRefName (required) — Target branch full ref, e.g. refs/heads/main.
- title (required) — Title of the pull request.
- additionalFields.description — Pull request description text. Sent only if non-empty.
- additionalFields.isDraft — Creates the PR as a draft when true. Only sent when true.
- additionalFields.reviewers — Comma-separated reviewer IDs. Each is trimmed and sent as {id}.
- additionalFields.workItemIds — Comma-separated work item IDs to link. Each is trimmed and sent as {id}. The description mentions URLs, but the code sends the raw value as the id, so numeric IDs are safest.
Output shape
One item per input item, containing the created pull request JSON (e.g. pullRequestId, status, repository, createdBy, url) as returned by Azure DevOps.
Uses a POST to the repository's pullrequests endpoint (api-version 7.1), authenticated with the configured PAT and organization credentials. Branch names must be full refs. If Continue On Fail is enabled, a failed item yields {error: message} instead of stopping the workflow.
Examples
Example 1: Open a PR from a feature branch into main
project=MyProject, repositoryId=my-repo, sourceRefName=refs/heads/feature-1, targetRefName=refs/heads/main, title='Add feature 1'
Example 2: Create a draft PR with reviewers and a linked work item
Set the required fields, then in Additional Fields: Is Draft=true, Reviewers='