Azure DevOps Server | Team Foundation Services (TFS)

Using Jira Server or Data CenterSee the corresponding article.

Integrate Azure DevOps Server/TFS with Jira Cloud

Quickly learn how to connect Azure DevOps Server/TFS git repositories via Git Integration for Jira app.

The Git Integration for Jira app supports Azure Repos.

What’s on this page:


Creating Personal Access Tokens

If you have not yet generated a personal access token (PAT), you can create one by following the simple steps in this article – use the table of content anchor link to go to the Azure DevOps Server/TFS section.

This step is highly required for Azure DevOps Server/TFS integrations connected via the Auto-Connect integration panel.

Permissions

Set Azure DevOps Server/TFS repository permissions according to your organization's rules. Viewing commits from Jira requires the user to have at least Read or View permissions. For branch/pull request creation, set specific service users with Write permissions.

Using Auto-Connect and OAuth

This process requires an existing Microsoft account with Azure DevOps Server/TFS git projects.

We recommend using the Auto-connect integration panel to connect multiple repositories from your Azure DevOps Server/TFS account.

  1. On the Jira Cloud dashboard menu, go to Apps ➜ Git Integration: Manage Git repositories. The git configuration page for connecting repositories is displayed.

  2. On the Auto-connect integration panel, click Microsoft. The following screen is displayed.

    1. Under On-premises group, select Team Foundation Server (TFS). If you are using Azure DevOps, choose that instead.

    2. Enter the Host URLUsername and Password for this connection.

      1. TFS 2017 and newer If PAT is configured in your TFS or Azure DevOps server, tick the Use Personal Access Token checkbox and enter your PAT in the provided field.

        1 2 3 4 5 6 IMPORTANT! ========== Do NOT include the <DOMAIN> in the Username field when Azure DevOps Server/TFS is connected to Active Directory. Example: "BigBrassBand\johnsmith" ==> "johnsmith"
      2. PATs were introduced with TFS 2017 and newer. TFS 2013 and TFS 2015 do not support PATs.

    3. Configuring the Advanced settings is optional. However, admins/power users may set how the project listing is displayed by configuring the following options:

      These settings are used with integration to retrieve the list of tracked repositories. Set a filter that will only load some cloned repositories which can be viewed via Actions ➜ Show integration repositories in the Manage Git repositories configuration screen.

      1. JMESPath filter  –  JMESPath is a query language for JSON used to filter API results and to limit which repositories are integrated. The maximum allowed length is 2000 characters or less.

        • If the field is empty, the Git Integration for Jira app will get all available accounts and then scans all available git repositories.

        • If the field is not blank, the app will assume it as a single account path and will try to use it. To connect to all available accounts, manually create integrations for each one of them.

        Read about JMESPath expressions on their website. For help with writing expressions, please contact support.
        To learn more examples, see article Jira Cloud: Working with JMESPath Filters.

      2. Suffix  –  This is a relative path that defaults to "/tfs".

        • The › Advanced twisty has the default /tfs path. Thus, there is no need to add the /tfs to the Host URL path. If you know your specific collection, type it in the provided box. The Git Integration app defaults to read and import all collection in the connected Azure DevOps Server/TFS server.

        • If this field is blank, the Git Integration for Jira app automatically appends the default "/tfs" suffix and scans for all the collections inside it.

        • If this field is not empty, the app assumes it as a single collection path and will try to use it.

      3. Connect specific collection  –  Turn this on to allow setting a collection to use. Turn this off (default) to scan for all collections.

      4. Collection  –  Enter a specific collection to use.

  3. Click Next to continue. Git Integration for Jira app will read all available repositories from Azure DevOps/VSTS.

  4. Click Next.

    • Currently, all available accounts are scanned and corresponding URLs are created internally. Repositories of the logged-in Microsoft user can be automatically connected to Jira Cloud. Repositories that are added or removed from Azure DevOps/VSTS will be likewise connected or disconnected from Jira Cloud.

  5. After the import process, the Settings dialog is displayed. If this is a PAT integration (personal access token is used to login), the integration setting wizard step is skipped. You can view the repository settings for this integration in the Manage git repositories page via Actions ➜ Edit integration settings.

    1. On the Integration Settings, setting the Require User PAT option to ON, will require users to provide PAT specific for branch and merge requests (via the developer panel » on the Jira issue page). For more information on this feature, see Integration Settings: Require User PAT ».

    2. Set Project Permissions according to your organization's project association rules. The default setting is Associate with all projects.

  6. Click Connect.

For now, only git projects are supported from Azure DevOps Server/TFS.

Azure DevOps/VSTS git repositories are now connected to Jira Cloud.

Single Repository Connection

Obtain the repository URL from the Azure DevOps Server/TFS repository project page. Choose between SSH or HTTPS.

  1. On your Jira Cloud dashboard menu, go to Apps ➜ Git Integration: Manage Git repositories.

  2. Click Connect to Git Repository to open the Connect Wizard.

  3. Paste the URL from Azure DevOps Server/TFS web portal in the provided box.

  4. Continue to the next step by following the screen instructions to complete this process.

The repository is now connected to Jira Cloud.

Troubleshooting Integration

Some repositories are not showing for the integration user. If this is the case, make adjustments to the configuration on the following settings:

  1. Permissions  –  verify correct permissions have been granted to the integration user.

  2. Grant access to the Git Integration for Jira app.

  3. Convert the current repository format to git.

For detailed information, see Troubleshooting: Repositories missing from Azure/VSTS/TFS integrations.

Webhooks and Web Linking

The Git Integration for Jira app automatically configures web linking for Azure DevOps Server/TFS git repositories.

Webhooks are supported on Azure DevOps and VSTS.
First - configure webhooks in the Git Integration app in Jira via the Git menu ➜ Manage Git Repositories then click Webhooks. Enable the feature and save the settings.  Then follow these instructions to setup the webhook trigger. Azure DevOps/VSTS webhooks will trigger an immediate index of all repositories within the integration.

For detailed step-by-step guide showcasing webhooks setup, see this article.

Linking Azure DevOps Server/TFS Git Commits to Jira Cloud

For the following steps, a Azure DevOps Server/TFS and a Visual Studio environment that supports git is required.

  1. Open Visual Studio IDE. Sign in to your Microsoft account, if prompted.

  2. Connect to your Azure DevOps Server/Team Foundation Server.

    1. Select a server in the dropdown list to connect to.

    2. If this is a new connection, add a new server by clicking Servers... :

      1. Type your Azure DevOps Server/TFS server Host URL

      2. Enter Username and Password, if prompted.

    3. Click OK to continue.

  3. Select a Team Project to work on then click Connect.

    • For first time connection to the Azure DevOps Server/TFS team project, the default work branch is master.

  4. On the Team Explorer, click Unsynced Commits or Sync.

  5. Click the Pull to clone the git repositories to your local machine.

  6. Make changes to the code of a file/project.

  7. On the Team Explorer, click Changes.

  8. Type a message for this commit.

    1 2 3 4 5 6 To associate this commit to the Jira issue page, mention the Jira issue key along with the commit message. For example: PRJ-123 Fix null code Where PRJ-123 is the Jira issue key and Fix null code is the commit comment.
  9. Click Commit and Push.

The commit is published to the Azure DevOps Server/TFS.  To view the commit in Jira, go to the Jira issue mentioned in the commit message. Click the Git Commits tab in the Activity row.

Viewing Git Commits in Jira Cloud

  1. Perform a git commit by adding the Jira issue key in the commit message. This will associate the commit to the mentioned Jira issue.

  2. Open the Jira issue.

  3. Scroll down to the Activity panel then click the Git Commits tab.

  4. Click View Full Commit to view the code diff.

Working with Branches and Pull Requests with Azure DevOps Server/TFS

This process requires a Azure DevOps Server/TFS git repository and a PAT with at least Code (read and write) scope.

This feature allows users to create branches and pull requests while inside Jira.

Default Branch

Most git integrations allow changing of the default branch of the repository/project other than "master".  This change is reflected in the  Repository Settings of the Git Integration for Jira app on the next reindex.  Auto-connected integrations support this feature where Git Integration for Jira app gets the default branch from almost all integrations and apply this setting at repository level. 

Main branch for repositories within an integration can only be changed on the git server.

Creating Branches

On your Jira Cloud, open a Jira issue. On the Jira developer panel under Git Integration, click Create Branch. For New Issue View, click Open Git Commits. The following dialog is displayed.

Pointers:

  1. Select a Repository from the list.

    1. The selected repository will display the git service logo to identify which git host it is located from.

    2. If there are several repositories with the same name, the listed Azure/TFS repositories will have their names attached with a owner/team name. For example, BigBrassBand/second-webhook-test-repo.

    3. Use the search box to look for the specific repository that will be used.

    4. Optional – designate the repository to be the default selected repository for current Jira project.  To configure default repositories for more than one Jira project - use the User settings page.

  2. Choose the newly-created branch as the Source branch.

  3. Set master as the Target branch.

  4. Enter a descriptive Title or leave it as is (recommended).

  5. Click Create Branch.

The branch is created and can be viewed under the Branches tab in your Azure DevOps Server/TFS.

PATs were introduced with TFS 2017 and newer. TFS 2013 and TFS 2015 do not support PATs. If the repository setting Require User PAT property is set to ON, the users will not be able to create/delete branches and pull requests.

To update the branch list to your Visual Studio's Team Explorer:

  1. Perform a Pull action on the connected team project.  The branches list in your VS IDE should be updated now.

  2. On the VS IDE Team Explorer, click Branches.

  3. Click New Branch then select the newly-created branch from the dropdown list.

  4. Click Create Branch.  The selected branch is now listed under the Published Branches in the Team Explorer.

  5. Make changes to a file or project then perform a commit to the selected branch.

    1. On the Team Explorer, click Changes.

    2. Make sure that Branch: displays the name of the newly-created branch.  If not, select it again from the list.

    3. This will associate the commit to the mentioned Jira issue key.

  6. Click the dropdown on the Commit button then select Commit and Push.

The commit is pushed to the new branch and is now ready for merge.

Creating Pull Requests

Before you can create a pull request, you need to create a branch first.

The pull request feature works the same as merge request.

On your Jira Cloud, open the Jira issue where your previously created a branch. On the developer panel under Git Integration, click Create Pull Request. The following dialog is displayed.

Pointers:

  1. Select your working Repository.

    1. The selected repository will display the git service logo to identify which git host it is located from.

    2. If there are several repositories with the same name, the listed Azure/TFS repositories will have their names attached with a owner/team name. For example, BigBrassBand/second-webhook-test-repo.

    3. Use the search box to look for the specific repository that will be used.

    4. Optional – designate the repository to be the default selected repository for current Jira project.  To configure default repositories for more than one Jira project - use the User settings page.

  2. Set the Source branch to the newly-created branch.

  3. Set the Target branch to master.

  4. Give the pull request Title a descriptive name or leave it as is.

  5. Click Create to create the pull request.

Pull/merge requests are still indexed based on branch name even if the PR/MR title does not have the Jira issue key – as long as the branch name contains the Jira issue key.

The branch and the pull request status are displayed on the developer panel.

The pull request is also listed in the Azure DevOps Server/TFS.

Merging Branch to master

Continuing from the above steps, the current branch is ready for merge.

  1. On your VS IDE Team Explorer, go to Branches.

  2. Click the Merge tab.

    1. Set the source to the branch you pushed the commits to.

    2. Set the target branch to master.

  3. Click the Merge button to continue.

The reviewer's approval is required to completely merge the pull request.  This usually takes place in the Azure DevOps Server/TFS web UI where your updated code is being reviewed.

Once approved, the team leader or reviewer can then complete the merge.  The commit can be viewed in the associated Jira issue page.

More Integration Guides