« Table of Contents

vsts logo TFS/Azure DevOps Server Integration Jira Server

Connect to TFS/Azure DevOps Server Jira Server

The Git Integration for Jira app supports Azure DevOps Server.

This process requires an existing Contributor user access to TFS/Azure DevOps Server projects.

  1. On your Jira Server dashboard menu, go to Git > Manage repositories.
  2. The git configuration page for connecting repositories is displayed.
  3. On the Auto-connect integration panel, click Microsoft.
  4. On the following screen, select TFS Server.  If you are using Azure DevOps, you should select it instead.
  5. Enter the Host URL, Username and Password for this connection. 
    helpful tip
    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 for Jira app defaults to read and import all collection in the connected TFS server.

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

    • JMESPath filter  –  JMESPath is a query language for JSON used to filter API results and to limit which repositories are integrated.  For help with writing expressions, please contact support mail icon.
    • Read about JMESPath expressions on their website opens in new tab/window.

      The maximum allowed length is 2000 characters or less.

      Example: value[?contains(name, 'git') || contains(name, 'test')] | {value:@}.

      This is a filter based on text in the repository name. It will list all the repositories that contain the specified names. Do note that the declared string format is case-sensitive.

    • Suffix  –  This is a relative path that defaults to "/tfs".
      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.
    • Connect specific collection  –  Turn this on to allow setting a collection to use. Turn this off (default) to scan for all collections.
    • Collection  –  Enter a specific collection to use.
    Click Connect to continue.
  6. Repositories of the connected Team Foundation Server can be automatically connected to Jira Server.  Repositories that are added or removed from TFS will be likewise connected or disconnected from Jira Server.
  7. Click Import repositories.
  8. After the import process, the Settings dialog is displayed:
    • On the Integration Settings, setting the Require User PAT option to ON will require users to provide a PAT which will be used for branch and merge/pull requests creation/deletion (via the developer panel on the Jira issue page). The recommended Selected scopes setting for this is Code (read and write).  For more information on this feature, see Integration Settings: Require User PAT icons.
    • warning
      PATs were introduced with TFS 2017.  TFS 2013 and TFS 2015 do not support PATs.  If this property is set to ON, the users will not be able to create/delete branches and pull requests.
      note
      When the above setting is enabled, a branch or pull request cannot be created until a valid personal access token (PAT) is set.
    • Set Smart Commits bbb icons and Repository Browser bbb icons to enable/disable these features.
    • Set Project Permissions according to your organization's project association rules.
  9. Click Finish.

The TFS repositories are now connected to Jira Server.

Configure Webhooks for Team Foundation Services

Webhooks are supported on TFS.  You can setup a webhook via Git menu > Manage Git Repositories then click Webhooks.  Enable it to use this feature.  It will trigger immediate index of repositories but will index all of them.

Working with Branches and Pull Requests with Git add-on and Team Foundation Server Jira Server

The Git Integration for Jira add-on supports creation of branches from Jira via the developer panel.

  1. Open a Jira issue then click Create Branch under Git Source Code > Branches group on the developer panel.
  2. The Create Branch dialog is displayed.
    • Select a Repository from the list.
    • Choose a Base branch (usually master)
    • Enter Branch name or leave it as is (recommended).
    If the Require User PAT option icons  is enabled in the Integration Settings and a user PAT isn't configured yet for the selected repository via Repository Browser:
    warning
    PATs were introduced with TFS 2017.  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.
    • Click the link label to setup the PAT.  This will show the Repository Browser listing connected git repositories.
    • Click the  icons  icon to setup a PAT for the selected repository.  Paste a valid PAT of the current user to proceed.  Invalid PATs will fail the branch creation process.
    • Click  icons  to use this PAT and save it to the current user profile. Click  icons   to cancel setting up PAT for this repository.
    • After the above steps have been taken, the users will be able to proceed with branch creation.
  3. Click Create Branch.
  4. The branch is created and can be viewed under the Branches tab in your TFS server.
  5. To update the branch list to your Visual Studio's Team Explorer, perform a Pull action on the connected team project.  The branches list in your VS IDE should be updated now.
  6. On the Team Explorer, click Branches.
  7. Click New Branch then select the newly-created branch from the dropdown list.
  8. Click Create Branch.
  9. The selected branch is now listed under the Published Branches in the Team Explorer.
  10. Make changes to a file or project then perform a commit to the selected branch:
    • On the Team Explorer, click Changes.
    • Make sure that Branch: displays the name of the newly-created branch.  If not, select it again from the list.
    • Click Commit and Push.

Pull Request

The pull request feature works the same as merge request.

To create a pull request and merge it to the main source (master):

  1. Open the Jira issue where you previously created a branch.
  2. On the developer panel under Git Source Code > Pull Requests, click Create pull request.
  3. The Create Pull Request dialog is displayed.
    • Select your working Repository.
    • Set the Source branch to the newly-created branch.
    • Set the Target branch to master.
    • Give the pull request Title a descriptive name or leave it as is.
    If the Require User PAT option icons  is enabled in the Integration Settings and a user PAT isn't configured yet for the selected repository via Repository Browser:

    Configure a valid PAT for the selected repository. Otherwise, the pull request creation will fail.

  4. Click Create.

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

The pull request is also listed in the TFS server:

 

Merging Branch to master

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

  1. On your Team Explorer, go to Branches.
  2. Click Merge.
    • Set the source to the branch you pushed the commits to.
    • Set the target branch to master.
  3. Click Merge to continue.

The reviewer's approval is required to completely merge the pull request. This usually takes place in the TFS server 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.

 

« Table of Contents