title | titleSuffix | description | ms.subservice | ms.topic | ms.author | author | ms.custom | monikerRange | ms.date |
---|---|---|---|---|---|---|---|---|---|
Configure pipelines to support integration |
Azure DevOps |
Learn how to configure pipelines to support integration with Azure Boards and work tracking |
azure-devops-pipelines-integrations |
how-to |
chcomley |
chcomley |
cross-service |
<= azure-devops |
09/09/2024 |
[!INCLUDE version-lt-eq-azure-devops]
To support integration and traceability across Azure DevOps Services with pipelines, you can configure several options. You can report pipeline status, copy the syntax for status badges, and set up automatic linking of work items to builds and releases.
Several features provide support for end-to-end traceability as user stories and features move through the development cycle. As with Azure Repos, you can link work items to pipeline objects with the following link types: Build, Integrated in build, and Integrated in release. The Integrated in release environment link can only be created by enabling the Report release status to Boards option in Classic release pipelines.
:::image type="content" source="media/pipelines-integration/concept-link-types-pipelines.png" alt-text="Conceptual image of link types that link work items to Azure Pipelines objects.":::
The following table summarizes the integration points between Azure Boards and Azure Pipelines. Options and configuration steps differ depending on whether you're configuring a YAML or Classic pipeline, and your Azure DevOps version. Most options are supported for pipelines run against an Azure Repos Git repository unless otherwise noted.
:::row::: :::column span="2"::: Feature :::column-end::: :::column span="2"::: Description :::column-end::: :::column span="1"::: Supported versions :::column-end::: :::row-end:::
:::row:::
:::column span="2":::
Manually link work items to builds
:::column-end:::
:::column span="2":::
You can link from a work item to builds within the same project or other projects within the organization. For more information, see Link to work items from other objects.
:::column-end:::
:::column span="1":::
All versions
:::column-end:::
:::row-end:::
:::row::: :::column span="2"::: View builds linked to from a work item :::column-end::: :::column span="2"::: You can view all builds linked to from a work item, whether manual or automatically linked, from the Links tab. For more information, see Link to work items from other objects, View list of linked objects. :::column-end::: :::column span="1"::: All versions :::column-end::: :::row-end:::
:::row:::
:::column span="2":::
Automatically link work items to builds
:::column-end:::
:::column span="2":::
Required to populate the Development control with Integrated in build links. The work items or commits that are part of a release are computed from the versions of artifacts. For example, each build in Azure Pipelines is associated with a set of work items and commits. For more information, see Automatically link work items later in this article.
:::column-end:::
:::column span="1":::
YAML, Azure DevOps Server 2020 and later
:::column-end:::
:::row-end:::
::: moniker range=">= azure-devops-2020"
:::row:::
:::column span="2":::
Automatically link work items to releases and report deployment status to a work item (Classic only)
:::column-end:::
:::column span="2":::
Required to populate Deployment control in work item form with Integrated in release stage links. For more information, see Report deployment status to Boards later in this article.
:::column-end:::
:::column span="1":::
Azure DevOps Server 2020 and later
:::column-end:::
:::row-end:::
::: moniker-end
:::row:::
:::column span="2":::
View list of work items linked to a build or release
:::column-end:::
:::column span="2":::
Review and open the work items included in a build or release.
:::column-end:::
:::column span="1":::
YAML, Azure DevOps Server 2020 and later
:::column-end:::
:::row-end:::
:::row:::
:::column span="2":::
Create work item on failure (Classic)
:::column-end:::
:::column span="2":::
Automatically create a work item when a build fails, and optionally set values for work item fields. For more information, see Create work item on failure later in this article.
:::column-end:::
:::column span="1":::
2018 and later versions
:::column-end:::
:::row-end:::
::: moniker range=">= azure-devops-2020"
:::row:::
:::column span="2":::
Query Work Items task, ensure the number of matching work items returned from a query is within a threshold.
:::column-end:::
:::column span="2":::
Use this task to ensure the number of matching items returned by a work item query is within the configured thresholds. For more information, see Query Work Items task, Control deployments with gates and approvals.
:::column-end:::
:::column span="1":::
Azure DevOps Server 2020 and later versions
:::column-end:::
:::row-end:::
::: moniker-end
- To configure the integration options for a Classic release pipeline, you must have permissions to edit the release.
- To link work items to commits and pull requests, you must have your Edit work items in this node permissions set to Allow for the Area Path assigned to the work item. By default, the Contributors group has this permission set.
- To view work items, you must have your View work items in this node permissions set to Allow for the Area Path assigned to the work item.
Open Pipeline settings
::: moniker range=">= azure-devops-2020"
For YAML-defined release pipelines, you configure the integration through the Pipeline settings dialog.
-
Open the pipeline, choose :::image type="icon" source="../../media/icons/more-actions.png" border="false"::: More actions, and then choose Settings.
:::image type="content" source="media/pipelines-integration/open-pipeline-settings.png " alt-text="Open Pipeline settings.":::
The Pipeline Settings dialog appears. For more information on automatic linking, see Automatically link work items later in this article.
:::image type="content" source="media/pipelines-integration/pipeline-settings-enable-link-work-items.png" alt-text="YAML Pipeline settings dialog.":::
::: moniker-end ::: moniker range="< azure-devops-2020" This setting isn't available for Azure DevOps Server 2019 or earlier versions. ::: moniker-end
Build properties
Open the build pipeline, choose to edit the pipeline, and then choose the Options tab.
::: moniker range=">= azure-devops-2019" :::image type="content" source="media/pipelines-integration/open-classic-build-properties-options.png" alt-text="Screenshot of Classic Build pipeline, Options tab."::: ::: moniker-end
The Build properties page appears.
::: moniker range=">= azure-devops-2019" :::image type="content" source="media/pipelines-integration/classic-build-options.png" alt-text="Build properties dialog.":::
For more information on each setting, use one of the following links:
::: moniker-end
Release integration options
For Classic release pipelines, open Pipelines>Releases, choose to edit your pipeline, then choose Options and then Integrations.
::: moniker range=">= azure-devops-2020"
For more information on each setting, use one of the following links:
- Report deployment status to the repository host
- Report deployment status to Work
- Report deployment status to Boards
- Report deployment status to Jira
- Enable the deployment status badge ::: moniker-end
::: moniker range="=azure-devops-2019"
For more information on each setting, use one of the following links:
- Report deployment status to the repository host
- Report deployment status to Work
- Enable the deployment status badge ::: moniker-end
::: moniker range=">= azure-devops-2020"
By enabling automatic linking, you can track the builds or releases that incorporated work without having to manually search through a large set of builds or releases. Every successful build associated with the work item automatically appears in the Development control of the work item form. Each release stage associated with the work item automatically appears in the Deployment control of the work item form.
::: moniker-end
::: moniker range="< azure-devops-2020"
By enabling automatic linking, you can track the builds that incorporated work without having to manually search through a large set of builds. Every successful build associated with the work item automatically appears in the Development control of the work item form.
::: moniker-end
::: moniker range=">= azure-devops-2020"
-
Open Pipeline settings as described in Open Pipeline settings.
-
Enable Automatically link new work in this build.
:::image type="content" source="media/pipelines-integration/pipeline-settings-enable-link-work-items.png" alt-text="Screenshot of Pipeline settings dialog, Automatically link work items in this build.":::
Once enabled, Integrated in build links are generated for all work items linked to the selected pull request with each release run. ::: moniker-end
::: moniker range="< azure-devops-2020" This feature isn't supported for YAML pipelines in Azure DevOps Server 2019. ::: moniker-end
-
Open pipeline Build properties as described in Build properties.
-
Enable Automatically link work items included in this run. Add the branches to include or exclude.
:::image type="content" source="media/pipelines-integration/auto-link-work-items-classic-build-pipeline.png" alt-text="Screenshot of Automatically link work items in this build property settings.":::Once enabled, Integrated in build are generated for all work items linked to the selected branches in each run.
To view a list of work items linked to the build, choose the Related link on the Summary page.
:::image type="content" source="media/pipelines-integration/build-view-work-items.png" alt-text="Screenshot of link to view work items linked to build.":::
-
Save your pipeline.
::: moniker range=">= azure-devops-2020"
Before you choose integration options, set up the release stages as described in Define your multi-stage continuous deployment (CD) pipeline.
-
Open Options>Integrations for the release pipeline as describe in Release integration options.
-
Check the Report deployment status to Boards checkbox. Map the Deployment type to each stage, or leave Unmapped. Select this option if you want to create links to all work items that represent associated changes to the source, when a release is complete. This option must be enabled in order for the work item form Deployment control to work.
:::image type="content" source="media/pipelines-integration/release-settings-stages-1.png" alt-text="Screenshot of Report deployment status to Boards, Classic release, five stages.":::
To view a list of work items linked to the release, choose Release (old view) from :::image type="icon" source="../../media/icons/actions-icon.png" border="false"::: More commands, and then choose the Work Items tab.
:::image type="content" source="media/pipelines-integration/release-pipeline-view-work-items.png" alt-text="Screenshot of link to view work items linked to a release.":::
-
Save your pipeline.
To verify the integration is working, perform the following steps:
-
Link one or more work items to a commit or pull request in Azure Repos Git repository. For more information, see:
-
Run the pipeline.
-
Open one of the linked work items and view the Deployment control. As shown in the following image, the Deployment control shows release information for two release stages those work items that linked to a Git commit or pull request for a release pipeline configured to integrate with Azure Boards.
:::image type="content" source="../../boards/work-items/media/deployments-control/deployment-control-intro.png " alt-text="Screenshot of Work item form, Deployment control.":::
::: moniker-end
When developing your software, you can link work items when you create a branch, commit, or pull request. Or, you can initiate a branch, commit, or pull request from a work item, automatically linking these objects as described in Drive Git development from a work item. For example, here we create a new branch from the Cancel order form user story.
:::image type="content" source="media/pipelines-integration/create-branch-link-work-item.png" alt-text="Create branch dialog from work item form.":::
When you automatically link work items to builds, the following computations are made:
-
For a first-time build:
- Identify all work items linked to the branch, commits, and pull requests associated with the build.
-
For subsequent builds:
- Identify all work items associated with the current commit (C1) being built.
- Identify all work items associated with the commit (C2) of the last successful build of the same source branch.
- Identify all work items associated with the commits between C1 and C2 in the commit tree.
If a build pipeline fails, you can automatically create a work item to track getting the problem fixed. You can specify the work item type and set options to automatically assign it to the requestor or other fields. The requestor corresponds to the person that triggered the build.
Tip
The option to Create work item on failure is only supported for Classic pipelines. To accomplish this with a YAML pipeline, you can use a marketplace extension like Create Bug on Release failure or you can implement it yourself using Azure CLI or REST API calls.
-
Open pipeline build options as described in Build properties.
-
Enable Create work item on failure and choose the type of work item to create. Optionally check the Assign to requestor checkbox to set the Assign To field and add fields to set within the work item to create.
For example, here we choose the Bug work item type and specify the Priority and Tags fields and their values.
:::image type="content" source="media/pipelines-integration/create-work-item-failure-yaml.png" alt-text="Screenshot of Create work item on failure in build options.":::
-
Save your pipeline.
To learn the reference name for a field, look it up from the Work item field index. For custom fields you add through an inherited process, Azure DevOps assigns a reference name based on friendly field name prefixed with Custom. For example, you add a field named DevOps Triage. The reference name is Custom.DevOpsTriage. No spaces are allowed within the reference name.
-
Open pipeline :::image type="icon" source="../../media/icons/more-actions.png" border="false"::: More Actions and choose Status badge.
:::image type="content" source="media/pipelines-integration/yaml-pipeline-more-actions-menu-options.png" alt-text="Screenshot of YAML pipeline More Actions menu options.":::
-
Choose the branch and scope of interest, and then choose :::image type="icon" source="../../media/icons/copy.png" border="false"::: Copy to clipboard to copy the image or Markdown syntax.
:::image type="content" source="media/pipelines-integration/status-badge-yaml.png" alt-text="Screenshot of YAML pipeline status badge.":::
-
Open pipeline Build properties as described in Build properties.
-
Choose :::image type="icon" source="../../media/icons/copy.png" border="false"::: Copy to clipboard to copy the image or Markdown syntax.
:::image type="content" source="media/pipelines-integration/classic-build-status-badge.png" alt-text="Screenshot of classic build properties, status badge section.":::
-
Save your pipeline.
Select this option if you want to display the latest outcome of a stage deployment on an external website.
-
Check the Enable the deployment status badge checkbox. And then, select the stages for which you want to display the outcome. By default, all the stages defined for the release are selected.
:::image type="content" source="media/pipelines-integration/enable-status-badge-3-stages.png" alt-text="Screenshot of Classic release enable deployment status badge with three stages selected.":::
-
Choose :::image type="icon" source="../../media/icons/copy.png" border="false"::: Copy to clipboard to copy the image or Markdown syntax.
:::image type="content" source="media/pipelines-integration/classic-release-status-badge-3-stages.png" alt-text="Screenshot of Classic release enable deployment status badge with three stages that you can copy.":::
-
Save your pipeline.
::: moniker range=">= azure-devops-2019"
When your code is stored in an Azure Repos Git repository, you can configure your release pipeline to display a badge on the Azure Repos pages. The badge indicates where the specific commit got deployed and whether the deployment is passing or failing. This option improves the traceability from code commit to deployment.
The deployment status is displayed in the following sections of Azure Repos:
- Files: Indicates the status of the latest deployment for the selected branch.
- Commits: Indicates the deployment status for each commit (requires the continuous integration (CD) trigger to be enabled for your release).
- Branches: Indicates the status of the latest deployment for each branch.
If a commit gets deployed to multiple release pipelines, with multiple stages, each has an entry in the badge with status shown for each stage. By default, when you create a release pipeline, deployment status is posted for all stages. However, you can selectively choose the stages for which deployment status should be displayed in the status badge (for example, show only the production stage). Your team members can select the status badge to view the latest deployment status for each of the selected stages of the release pipelines.
::: moniker-end
::: moniker range=">= azure-devops-2020"
Include Jira issues in work items and create links to all issues on stage completion. Install Azure Pipelines for Jira app in Jira Software cloud and add organization to create a connection.
:::image type="content" source="media/pipelines-integration/integration-options-classic-jira.png" alt-text="Screenshot of Integrations options for Classic pipelines, Report deployment status to Jira":::
To support integration with Jira issue tracking, install Azure DevOps for Jira and connect your Azure DevOps organizations with your Jira Software instance. You can connect multiple organizations with one instance and get data for all your teams and related projects. For more information, see Connect Azure DevOps to Jira.
::: moniker-end
- Define a multi-stage continuous deployment (CD) pipeline
- Link work items to other objects
- Review the release pipelines (Classic) overview
- Retrieve all work items associated with a release pipeline using Azure DevOps API
- Drive Git development from a work item
- Link work items to other objects
- Ensure end-to-end traceability
- Refer to the link type reference