SpecSync Documentation
Getting StartedConfigurationGuidesDownloads
Azure DevOps
Azure DevOps
  • Introduction to SpecSync for Azure DevOps
  • Getting started
    • Getting started using SpecFlow
    • Getting started using Cucumber or other Gherkin-based BDD tool
  • Installation & Setup
    • Install as .NET tool
    • Install as .NET Console App
    • Install as native binaries for Linux or macOS
    • Install as Docker image
    • Setup and Configure
  • Features
    • Push features
      • Pushing scenario changes to Test Cases
      • Configuring the format of the synchronized test cases
      • Synchronizing Scenario Outlines
      • Add new Test Cases to an Area or an Iteration
      • Mark Test Cases as Automated
      • Setting Test Case state on change
      • Update Test Case fields
      • Attach files to Test Cases using tags
      • Customization: Setting Test Case fields with default values
      • Customization: Update custom Test Case fields on push
      • Customization: Ignoring marked Test Case steps
      • Customization: Ignoring Test Case Tags
      • Customization: Ignore non-supported local tags
      • Customization: Mapping tags
      • Customization: Synchronizing scenarios from feature branches
      • Customization: Reset Test Case state after change
      • Customization: Automatically link changed Test Cases
      • Customization: Synchronize linked artifact titles
      • Customization: Add Test Cases to Suites
      • Customization: Do not synchronize title
    • Pull features
      • Pulling Test Case changes to local scenarios
    • Common synchronization features
      • Configuration key
      • Remote scope
      • Linking Work Items using tags
      • Synchronizing Test Case hierarchies using Test Suites
      • Include synchronized Test Cases to a Test Suite (deprecated)
      • Excluding scenarios from synchronization
      • Synchronization conflict resolution
      • Re-link scenarios to new Test Cases
    • Test result publishing features
      • Publishing test result files
      • Support for Azure DevOps Test Plan / Test Suite based test execution
      • Customization: Publishing test results to multiple Test Suites
    • General features
      • Azure DevOps authentication options
      • Configuration file
      • Hierarchical configuration files
      • Local test case conditions
      • Configuration wizards
      • SpecSync plugins
    • Customizations
    • Plugin list
  • Licensing
  • Guides
    • What is my Azure DevOps project URL?
    • How to define the local feature-set to be synchronized
    • Filters and scopes
    • How to synchronize automated test cases
    • How to use SpecSync from build or release pipeline
    • How to publish test results from pipelines using the VSTest task
    • How to use the SpecSync Azure DevOps pipeline tasks
    • How to link GitHub pull requests
    • How to upgrade to a newer version of SpecSync
    • How to attach files to test results
    • Using SpecSync with SpecFlow+
    • Using SpecSync with Cucumber
    • Using SpecSync with Cypress
    • Using SpecSync with Postman
    • Using SpecSync with TestNG
    • Using SpecSync on macOS or Linux
    • Using SpecSync inside a Docker container
    • How to handle Test Cases of multiple parallel application releases
    • Migrating from SpecSync v3 to v5
    • Migrating from SpecSync v2 to v3
    • Migrating from SpecSync v1 to v2
  • Changelog
  • Release Model and Roadmap
  • Downloads
  • Reference
    • Command line reference
      • init
      • upgrade
      • push
      • pull
      • publish-test-results
      • re-link
      • version
    • Configuration reference
      • toolSettings
      • local
      • remote
      • knownRemotes
      • synchronization
        • push
        • pull
        • automation
        • state
        • areaPath
        • iterationPath
        • links
        • attachments
        • format
        • fieldUpdates
      • hierarchies
      • publishTestResults
      • specFlow
      • reqnroll
      • customizations
    • Compatibility
    • Older versions
  • Contact
    • SpecSync Support
    • Troubleshooting
    • FAQ
  • Project Website
Powered by GitBook
On this page
  • Linking GitHub pull requests with tags
  • Linking GitHub pull requests when the test case changes

Was this helpful?

  1. Guides

How to link GitHub pull requests

PreviousHow to use the SpecSync Azure DevOps pipeline tasksNextHow to upgrade to a newer version of SpecSync

Last updated 2 years ago

Was this helpful?

Recent versions Azure DevOps support linking Test Cases to GitHub pull requests. You can configure SpecSync to establish such links using th and the .

In order to use this feature you need to make sure that this feature is enabled in your Azure DevOps project and you can link GitHub pull requests manually via the Azure DevOps user interface. Please check the for details on how linking works.

If you cannot link GitHup pull requests manually, then the GitHub integration is not properly configured for your project. In essential, you need to connect the Azure DevOps project with the GitHub project using the Azure Boards-GitHub integration. See more details on the setup in the about this.

Linking GitHub pull requests with tags

For linking a Test Case with a particular GitHub pull request (e.g. the with the pull request that introduced the test), you need to first configure a link prefix using the .

The following example configures the tag prefix GHPR. The relationship setting has to be set to GitHub Pull Request and you need to provide the link template to your GitHub pull request. In the link template, you have to use {id} at the position where the pull request ID should be inserted.

{
  ...
  "synchronization": {
    ...
    "links": [
      {
        "tagPrefix": "GHPR",
        "relationship": "GitHub Pull Request",
        "linkTemplate": "https://github.com/my-org/my-project/pull/{id}"
      }
    ],
    ...
  },
  ...
}

With the link configured, you can add tags to your scenarios in order to establish a link to the GitHub pull request. The following example shows how to link the scenario Add two positive numbers to the GitHub pull request #123 using the GHPR link prefix we configured above.

@tc:1234
@GHPR:123
Scenario: Add two positive numbers

From SpecSync v3.4, you can also use the full pull request URL in the tag:

@tc:1234
@GHPR:https://github.com/my-org/my-project/pull/123
Scenario: Add two positive numbers

Linking GitHub pull requests when the test case changes

The customization also works with GitHub pull requests: you can link the Test Cases to a GitHub pull request in your build pipeline. For that, you need to specify GitHub Pull Request as relationship and you have to specify the GitHub pull request link template for the linkTemplate setting. In the link template, you have to use {id} at the position where the pull request ID should be inserted.

The following customization links the changed Test Cases to the GitHub pull request set in the environment variable ENVVAR_WITH_PR_NUMBER. (If the environment variable is unset or empty, it will not add additional links.)

{
  "customizations": {
    "linkOnChange": {
      "enabled": true,
      "links": [
        {
          "targetId": "{env:ENVVAR_WITH_PR_NUMBER}",
          "relationship": "GitHub Pull Request",
          "linkTemplate": "https://github.com/my-org/my-project/pull/{id}"
        }
      ]
    }
  }
}

The can automatically establish links to the Test Cases that are changed during the current push command. This might be useful for CI/CD pipeline executions. See feature description for details.

Link tags feature
Link on change customization
Azure DevOps documentation
Azure DevOps documentation
Link tags feature
Link on change customization