Join us December 10-11, 2024
| Developer Experience + AI Conference
Register now free →
Search
Close this search box.

Git Blog

Releasing the Power of Git

Jira Git Tips Using Git Integration for Jira

You can integrate Git with Jira using Git Integration for Jira. Git Integration for Jira is an app that allows users to drive Jira with Git. This Jira Git integration tool allows you to spend less time context switching between Jira and Git and more time writing and delivering awesome code.

Many development teams use Git and Jira in their regular development process to contribute to and track the progress of a project. Git is primarily used by the technical members of a team to contribute code to a project. Jira, on the other hand, is generally used by technical and non-technical users alike to view and communicate about a project’s status. 

In this article, we will cover a variety of tips for using Git and Jira that can help you enhance team visibility on projects, save time, and improve productivity.

Jira Git Tips Covered in This Article

*While this article focuses on using Git for Jira Cloud, many of the same features covered in this article are available for Jira Server and Jira Data Center. Visit Git Integration for Jira’s official documentation to find resources regarding Jira Server and Jira Data Center. 

How to Set up a Jira Git Integration

The first step to creating your Jira Git integration is to install Git Integration for Jira. You can opt to begin a free 30-day trial if you’d like to preview the tool before purchasing a subscription. 

Once Git Integration for Jira is installed, you can connect Git to Jira by connecting your remote repositories from your preferred Git hosting service. Git Integration for Jira supports all Git servers, meaning you can integrate with GitHub, GitLab, Bitbucket, and more! The example below details how to connect remote repositories from GitHub using a Jira GitHub integration.

  1. From the top toolbar in Jira, select Apps
  2. Select Git Integration: Manage integrations from the dropdown that appears 
  3. Click the Add integration button near the center of your screen
  4. Select Git service integration (Recommended)
  5. Select either GitHub.com - OAth or GitHub.com - Personal Access Token 
  6. Click the Connect GitHub.com button 
  7. Enter your GitHub account information and select Sign in

The above actions will take you to a page where you can connect one or multiple repositories to Git Integration for Jira by simply selecting the checkbox by the desired repo’s name. 

Easy as that! You have now learned how to integrate Git with Jira and how to use Jira to add a Git repository. 

Create Git Branch from Jira Ticket

Git Integration for Jira allows you to create Git branches directly from a Jira issue. You may also hear people refer to Jira issues as Jira tickets. While Jira issue is the official term, ticket and issue are used interchangeably and mean the same thing. Creating a Git branch from Jira is a process that can be started in two different ways, depending on your preference.

You can start the process of creating a Git branch by using the Create branch button just beneath the Git Development panel in the center of the issue. Alternatively, you can start creating a Git branch from Jira by selecting the Open Git Integration button at the bottom of the Details panel, and then selecting Create branch. Regardless of which process you use to start the branch creation process, the following options to finish creating the Git branch from Jira are the same.  

  1. From the Repository dropdown menu, choose the Git repository you want the branch to be created in 
  2. Select a branch from the Source branch dropdown menu
  3. Git Integration for Jira auto-populates a suggested branch name in the Branch name field. Make any desired adjustments to the branch name 
  4. Click the Create branch button

You can confirm that the Git branch was created successfully by navigating to the Details panel, hovering over the # branch, and selecting the subsequent Open branch icon that appears. This will take you to the recently created Git branch on your Git hosting service. To interact with the newly created branch locally, you’ll need to perform a Git fetch or Git pull.

Disable the Ability to Create a Git Branch from Jira

Some Jira administrators prefer to disable the ability to create a Git branch from Jira to avoid potential mishaps with non-technical users. For example, imagine how confusing a repository could get if a non-technical user on your team inadvertently created 10 random Git branches. 

While mistakes like the scenario above are certainly not the norm, if you don’t want users to have the ability to create a Git branch from Jira, you can easily disable this feature. To disable the Create branch option, follow these steps: 

  1. Select Apps from the top toolbar 
  2. From the dropdown menu, select Git Integration: Manage integrations
  3. From the left panel, select General settings
  4. Scroll down to the Git Integration Options heading and deselect Enable create/delete branch
  5. Scroll to the bottom of the General settings options and select the blue Update button

Create Pull Request from Jira

Ready to submit your work to be reviewed by a project manager? You can initiate a pull request right from a Jira ticket!  

To create a Jira pull request, you can either click the Create pull request button from the Git Development panel in the center of the issue, or the Open Git Integration button at the bottom of the Details panel. From there, select Create pull request. Just like the process to create a Git branch from Jira, it does not matter which path you take to initiate your pull request as the subsequent steps are the same. 

  1. Select the desired repository where you want to start your pull request from the Repository dropdown menu
  2. From the Source branch dropdown menu, select the branch that contains the changes you want to merge
  3. From the Target branch dropdown menu, select the desired branch where you want your changes to be merged to 
  4. Git Integration for Jira automatically populates the Title field with the following format:  issue key merge <source branch> to <target branch>. If necessary, make adjustments to the pull request title
  5. Click the Create pull request button

To verify that you have created a pull request from Jira, navigate to the Details panel, hover over the # pull request, and select the subsequent Open pull request icon that appears. This will allow you to view the pull request on your Git hosting service. 

Git Integration for Jira allows teams to view a list of all the pull requests associated with a Jira issue, helping them stay organized and on track.

Install Git Integration for Jira

Disable the Option to Create Pull Request from Jira

Just as some Jira admins may disable the option to create a Git branch from Jira, they may also choose to disable the option to create a pull request from Jira to protect repositories from accidental changes made by non-technical team members. You can disable pull request creation from Jira with a few simple steps: 

  1. From the top toolbar, select Apps 
  2. Select Git Integration: Manage integrations from the dropdown menu 
  3. Select General settings from the left panel 
  4. Scroll down to the Git Integration Options heading and deselect Enable create pull/merge request
  5. Navigate to the bottom of the General settings options and click the Update button

How to Set Up a Jira Webhook

On its own, Jira re-indexes, or checks for updates on, connected Git repositories about every 8-minutes. However, you can configure Jira webhooks, also called indexing triggers, to update Jira more frequently. Jira webhooks can be set up to automatically reindex a repository when certain Git actions occur, such as a Git commit or Git push. To configure Jira webhooks in Jira Cloud, follow the steps outlined below:

  1. From the top toolbar in Jira, select Apps
  2. Select Git Integration: Manage integrations from the dropdown menu
  3. Select Indexing triggers from the left sidebar
  4. Make sure that indexing triggers are enabled by toggling the button beneath Indexing triggers settings
  5. Navigate to your Git hosting service and select the repository you want to add indexing triggers to 
  6. Select the repo Settings from the top toolbar
  7. Select Webhooks from the left sidebar
  8. Click the Add webhook button at the top right
  9. Navigate back to Jira 
  10. Copy the URL for the Jira webhook
  11. On your Git hosting service, paste the Jira webhook URL into the Payload URL field
  12. Click Content type and select application/json from the dropdown menu
  13. Return to Jira and copy the Secret key beneath the Indexing triggers settings header
  14. Navigate to your Git hosting service and paste the Secret key in the Secret field
  15. Select which events you want to trigger the Jira webhook like commits, pushes, pull requests, etc.
  16. Click the Add webhook button

Now your repositories will automatically reindex when the events you selected, like a Git commit, occur, thanks to your Jira webhooks.

Save Time with Git Integration for Jira

In this article, we’ve shown how you can create a Jira Git Integration with Git Integration for Jira. Each time you create a Git branch from Jira, create a pull request from Jira, or create a Jira webhook, you’re saving precious minutes. While that may not have a dramatic impact on one day, those small increments of time saved become hours, and before you know it, you’ve wildly improved your overall productivity. Start saving time today by installing Git Integration for Jira.

Like this post? Share it!

Read More Articles

Make Git Easier, Safer &
More Powerful

with GitKraken
Visual Studio Code is required to install GitLens.

Don’t have Visual Studio Code? Get it now.

Team Collaboration Services

Secure cloud-backed services that span across all products in the DevEx platform to keep your workflows connected across projects, repos, and team members
Launchpad – All your PRs, issues, & tasks in one spot to kick off a focused, unblocked day. Code Suggest – Real code suggestions anywhere in your project, as simple as in Google Docs. Cloud Patches – Speed up PR reviews by enabling early collaboration on work-in-progress. Workspaces – Group & sync repos to simplify multi-repo actions, & get new devs coding faster. DORA Insights – Data-driven code insights to track & improve development velocity. Security & Admin – Easily set up SSO, manage access, & streamline IdP integrations.
winget install gitkraken.cli