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
- How to Set up a Jira Git Integration
- Create a Git Branch from Jira Ticket
- Disable Git Branch Creation from Jira
- Create Pull Request from Jira
- Disable Pull Request Creation from Jira
- How to Set up a Jira Webhook
- Save Time with Git Integration for Jira
*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.
- From the top toolbar in Jira, select Apps
- Select Git Integration: Manage integrations from the dropdown that appears
- Click the Add integration button near the center of your screen
- Select Git service integration (Recommended)
- Select either GitHub.com - OAth or GitHub.com - Personal Access Token
- Click the Connect GitHub.com button
- 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.
- From the Repository dropdown menu, choose the Git repository you want the branch to be created in
- Select a branch from the Source branch dropdown menu
- Git Integration for Jira auto-populates a suggested branch name in the Branch name field. Make any desired adjustments to the branch name
- 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:
- Select Apps from the top toolbar
- From the dropdown menu, select Git Integration: Manage integrations
- From the left panel, select General settings
- Scroll down to the Git Integration Options heading and deselect Enable create/delete branch
- 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.
- Select the desired repository where you want to start your pull request from the Repository dropdown menu
- From the Source branch dropdown menu, select the branch that contains the changes you want to merge
- From the Target branch dropdown menu, select the desired branch where you want your changes to be merged to
- 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
- 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.
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:
- From the top toolbar, select Apps
- Select Git Integration: Manage integrations from the dropdown menu
- Select General settings from the left panel
- Scroll down to the Git Integration Options heading and deselect Enable create pull/merge request
- 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:
- From the top toolbar in Jira, select Apps
- Select Git Integration: Manage integrations from the dropdown menu
- Select Indexing triggers from the left sidebar
- Make sure that indexing triggers are enabled by toggling the button beneath Indexing triggers settings
- Navigate to your Git hosting service and select the repository you want to add indexing triggers to
- Select the repo Settings from the top toolbar
- Select Webhooks from the left sidebar
- Click the Add webhook button at the top right
- Navigate back to Jira
- Copy the URL for the Jira webhook
- On your Git hosting service, paste the Jira webhook URL into the Payload URL field
- Click Content type and select application/json from the dropdown menu
- Return to Jira and copy the Secret key beneath the Indexing triggers settings header
- Navigate to your Git hosting service and paste the Secret key in the Secret field
- Select which events you want to trigger the Jira webhook like commits, pushes, pull requests, etc.
- 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.