Summary: ◀▼
You can connect action builder to Microsoft Azure DevOps to automate workflows that create, update, and manage work items, pull requests, projects, and pipelines. Use external actions like creating work items, adding comments, triggering pipeline runs, and retrieving statuses to improve collaboration and streamline task management across platforms. Use a dedicated service account for secure authentication and proper permissions.
Connecting Microsoft Azure DevOps to action builder
Before you can include external actions in your action flows, you must connect the action builder to the external system.
- All external actions performed by an action flow are attributed to the user who connected the external system. Therefore, it's a best practice to use a dedicated service account rather than personal credentials when connecting to each external system.
- All integrations request access to necessary scopes. However, it's important that you review and validate the scopes before authorizing the connection to the external system.
- When managing credentials for API key-based tools, such as OpenAI, it's best to store keys in a secure vault or credential manager.
- In Admin Center, click
Apps and integrations in the sidebar, then select Actions > Action
flows. - Create or edit an action flow.
- Open the step sidebar.
- Under External actions, click Microsoft Azure DevOps.
- Click Connect.
- Follow Microsoft Azure DevOps's prompts to authenticate and complete the
connection.
The Microsoft Azure DevOps connection uses OAuth 2.0 for secure authentication. You'll be redirected to Microsoft to authorize access to your Azure DevOps organization. The connector automatically handles token refresh when needed.
Ensure the authenticating user has appropriate permissions in your Azure DevOps organization for the operations you plan to perform through action flows.
Note: All external actions performed by an action flow are attributed to the user who connected the external system. Therefore, it is a best practice to use a dedicated service account rather than personal credentials when connecting to each external system.
After you've connected to the system, you'll see an indicator that it's connected and details about the instance you're connected to, as well as the actions available for Microsoft Azure DevOps.
Using Microsoft Azure DevOps actions in action flows
Creating a work item
Use the Create work item action to create a new work item in an Azure DevOps project.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Organization,
Project, Work item
type, TitleThe Work item type field dynamically populates based on your project configuration and may include Bug, Task, User Story, Epic, Feature, or custom types. Optional:
Optional fields vary by work item type (for example, Repro steps for Bugs, Acceptance criteria for User Stories). |
| Output | Work item object including id, rev, work_item_type, title, description, state, assigned_to, created_date, changed_date, url, and all field details. |
Updating a work item
Use the Update work item action to modify an existing work item's fields.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Organization, Work
item IDOptional: Only provided fields are changed. Existing values for fields you don't specify remain unchanged. Selecting a Project enables state, area path, and iteration path options specific to that project. |
| Output | Updated work item object including id, rev, work_item_type, title, changed_date, url, and all updated field details. |
Looking up a work item
Use the Lookup work item action to retrieve detailed information about a specific work item by its ID.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Organization, Work
item IDOptional: Set Expand relations to Yes to include parent, child, and related work items as well as links and attachments. Set Expand comments to Yes to include all comments and discussion history. |
| Output | Work item object including all fields, with optional parent, children, related_work_items, attachments, and comments array. |
Adding a comment to a work item
Use the Add comment to work item action to post a comment on a work item.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Organization,
Project, Work item ID,
Comment text
|
| Output | Comment object including comment_id, work_item_id, text, created_by, created_date, modified_date, url, and comment_version. |
Listing work items
Use the List work items action to search for work items using WIQL (Work Item Query Language) or filter fields.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Organization,
ProjectOptional:
You can use the Query field to write custom WIQL queries for advanced filtering, or leave it blank to use the simple filter fields below. Max results defaults to 50 and cannot exceed 200. Sort field accepts Changed Date, Created Date, Title, or Priority. |
| Output | Results array of work items with total_count and has_more pagination flag. |
Creating a pull request
Use the Create pull request action to create a new pull request in a Git repository.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Organization,
Project, Repository,
Source branch, Target
branch, TitleOptional:
Branch names should use the
format Reviewers should be comma-separated email addresses. Work item IDs should be comma-separated numeric IDs. Set Is draft to Yes to create as a draft pull request. |
| Output | Pull request object including pull_request_id, title, description, status, created_date, created_by, repository, source_branch, target_branch, reviewers array, work_item_refs array, url, and web_url. |
Updating a pull request
Use the Update pull request action to modify an existing pull request.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Organization,
Project, Repository,
Pull request IDOptional:
Only provided fields are changed. Status accepts active, completed, or abandoned. Set Auto complete enabled to Yes to automatically merge when all policies pass. |
| Output | Updated pull request object including pull_request_id, title, status, merge details, last_merge_commit, closed_date, url, and web_url. |
Looking up a pull request
Use the Lookup pull request action to retrieve detailed information about a specific pull request.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Organization,
Project, Repository,
Pull request IDOptional:
Set Include commits to Yes to retrieve all commits included in the pull request. Set Include work items to Yes to retrieve linked work items. |
| Output | Detailed pull request object including all fields, reviewers array, labels array, optional commits and work_item_refs arrays, completion_options, url, and web_url. |
Listing pull requests
Use the List pull requests action to retrieve pull requests from a Git repository.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Organization,
Project,
RepositoryOptional:
Status accepts all (default), active, completed, or abandoned. Max results accepts 1-100 (default: 50). Use Skip for pagination to skip the first N results. |
| Output | Pull requests array with pull request objects plus pagination details with total_count and has_more flag. |
Looking up a project
Use the Lookup project action to retrieve details about a specific Azure DevOps project.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Organization,
ProjectOptional: Set Include capabilities to Yes to retrieve version control and process template details. Set Include history to Yes to retrieve project change history. |
| Output | Project object including id, name, description, state, visibility, default_team, url, with optional capabilities and history. |
Listing projects
Use the List projects action to retrieve all projects in an organization.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: OrganizationOptional:
State filter accepts All, WellFormed (active projects, default), Deleting, or New. Max results accepts 1-100 (default: 100). |
| Output | Projects array with project objects including id, name, description, state, visibility, and url, plus total_count and continuation_token. |
Listing pipelines
Use the List pipelines action to retrieve build and release pipelines in a project.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Organization,
ProjectOptional: Pipeline
name supports partial matching. Folder path format is
|
| Output | Pipelines array with pipeline objects including id, name, folder, revision, url, and web_url, plus total_count and continuation_token. |
Triggering a pipeline run
Use the Trigger pipeline run action to manually trigger a pipeline execution.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Organization,
Project, Pipeline
IDOptional: Branch format is
Variables should be a JSON object (for example,
|
| Output | Run object including run_id, run_number, pipeline details, state, result, created_date, finished_date, url, and web_url. |
Getting pipeline run status
Use the Get pipeline run status action to retrieve the status and details of a pipeline run.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Organization,
Project, Pipeline ID,
Run ID
|
| Output | Detailed run object including run_id, run_number, name,
state, result, pipeline details, created_date, and
finished_date. State indicates the current status (in progress, completed, canceling, cancelled). Result indicates the outcome (succeeded, failed, canceled, etc.). |
Listing pipeline runs
Use the List pipeline runs action to retrieve recent runs for a specific pipeline.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Organization,
Project, Pipeline
IDOptional: Result filter accepts all, succeeded, failed, etc. Max results accepts 1-100 (default: 50). |
| Output | Runs array with run objects including run_id, run_number, state, result, and urls, plus total_count and continuation_token. |