logo flat Git Integration for Jira. See Git commits in Jira.

Tips for Jira Admins (Server)

Welcome, Jira administrators!  In this page, you will be seeing some useful tips on how to get more productive using the Git Integration for Jira add-on.

What can you find in this page:


Indexing Strategies

Smart Commits

To improve performance, turn off smart commits on initial indexing then turn it back on after initial reindexing.

Repository setting smart commit

Indexing strategies to reduce strain on system

In some cases with large amount of repositories, there could be some frequent pushes that can have large changes.  This can affect Jira performance and slow it down over time.

Below are some tried approaches to help improve performance:

  1. Disabling Revision Indexing for particular repositories.  Select the "Do not index and link to the revision history" option on Update Repository settings page for repositories that you want to exclude from processing.
  2. Repository setting Repository Revision
  3. Turning off reindex scheduler + manual reindexing.  The administrator performs reindex manually for all or particular repositories.  No regular updates occur.  This approach can be less convenient. To switch off scheduled reindexing, go to the General settings page and specify a zero value to Reindex interval.
  4. General setting Reindex Interval
  5. Turning off reindex scheduler + web hooks.  This approach works for git hosts that supports the Webhooks feature, for example, GitHub and GitLab.  The indexing will be called only when there are push events for some repositories.  The process of one index call can be completed faster because the number of repositories that are to be indexed will become less compared to scheduled re-indexing.  For this approach, set Reindex Interval to zero then enable Webhooks.
  6. Repository setting enable/disable Webhooks
  7. Disabling smart commits for particular repositories.  The indexing process includes a phase for smart commits processing while detecting some commands against Jira issues.  The length of the indexing process can reduced if smart commits is turned off for the particular repository.  Smart commits are enabled by default for any newly connected repository.
  8. Repository setting smart commit

 

Adding New Repositories

When adding a new repository, users might be able to encounter an indexing issue where the progress takes a long time to finish. This can only happen for large remote repositories having long history and heavy file set.  During this situation, we highly recommend to inspect it for some large branches or binary files.

We also suggest the following article which covers problems of large repositories and possible solutions for them.  Look for the topic, Handling Repositories with Huge Binary Assets.


Bulk Change

Accessing the bulk change feature from Jira administration - Repositories config page

The Bulk Change feature allows administrators to easily import or export repository configuration into a tab-delimited file.

This feature is best suited for the following occasions:

  • When reinstalling the Git Integration for Jira add-on. Backup repository configuration by exporting it. Reinstall the Git add-on. Import the repository configuration again. This ensures automatic reconnection of the managed git repositories.
  • For administrators who have several git repositories. The Git add-on allows importing of multiple repository configuration using a tab-delimited file (.tsv). This will make managing large git repository list more efficient.
  • When moving your git repository configuration from an old Jira server to a new Jira server.  Exporting and importing of git repository configuration via Bulk Change is quick and easy.  The Git Integration for Jira Server add-on has the same export/import format with the Cloud version making a seamless transition.

The bulk change export function allows Jira administrators to create a backup copy of the git repository configuration into a tab-delimited file and can be edited using any spreadsheet application.

When editing the tab-delimited file, the following rules must be considered:

  • The header row is required.
  • The columns must not be reordered.
  • if a column field is ommitted, the Git add-on will use the default values.
  • Put the word delete in the delete column to confirm removal of the selected repository from the repository configuration upon bulk import.

When saving the file to a tab-delimited (.tsv) format:

  • OSX users  –  select all data in Numbers and then paste into a text editor and save.  Name the file with the .tsv extension (repo-example-00.tsv).
  • Excel users  –  save the file as Text (Tab delimited) (*.txt).  Rename the file's .txt extension to .tsv.
  • Google Drive  –  upload the file to this service.  Right click the .tsv file then open it with Google Sheets.  Make the necessary changes then go to File > Download as > Tab separated values (.tsv) to your local machine.

Webhooks

With Git Integration for Jira add-on, setting up webhooks on your remote git host offers almost instantaneous reindexing of git repositories.  For example, if you made a change in a file from the git repository and then commit it, the Git add-on can fetch it immediately and updates the changes into Jira.

Administrators can enable/disable this feature via Jira Administration > Add-ons/Applications > Git Integration for Jira > Webhooks.

Accessing the webhook feature from Jira administration - Repositories config page

The secret key is provided at the time of the Git add-on installation.  Administrators can change this to a different value by generating another secret token from your git host.

Use this key in the form of:

<JIRA_BASE_URL>/git/webhook/reindex/<SECRET_KEY>
fyi
All the repositories will be reindexed if the URL specified above is activated through  GET ,  POST , or  PUT  and the webhooks are enabled.

There will be no authentication checking and support for other HTTP methods such as  DELETE  or  HEAD .  The body of a  POST  or  PUT  is ignored.

For detailed information, usage and examples, see Hook and API Reference - Webhooks open in new tab.


REST APIs

The Git Integration for Jira add-on supports REST APIs which can be used for automation process via scripts.

Bulk Change REST API

The bulk change API extends the possibility of importing and exporting repository configuration.

There are three methods:

  1. Bulk Export (GET)  –  This API will return a tab-separated values (.tsv) file with the repository configuration.
  2. Bulk Import (POST)  –  This API will start the process of importing repository configuration from the specified (.tsv) file.
  3. Get Bulk Import Information (GET)  –  This API will obtain information about the importing thread.

For detailed information, usage and examples, see Hook and API Reference - Bulk Change REST API open in new tab.

Repository REST API

The repository API allows the query and management of the project repository list.

There are four methods:

  1. Retrieve Repository List (GET)  –  This API will retrieve the list of repositories mapped to a given project.
  2. Add New Repository (POST)  –  This API will create a new repository from the given settings.
  3. Update Existing Repository (PUT)  –  This API will update the existing repository using the given settings.
  4. Delete Repository (DELETE)  –  This API will delete the existing repository from the Git add-on repository configuration list.

For detailed information, usage and examples, see Hook and API Reference - Repository REST API open in new tab.

Reindex REST API

This REST API will give more control on the indexing.

There are two methods:

  1. Reindex (POST)  –  This API will start the reindex process in a separate thread and returns the result immediately.
  2. Reindex (GET)  –  Use this API to track messages for a particular thread.

For detailed information, usage and examples, see Hook and API Reference - Reindex REST API open in new tab.

Commits REST API

The commits (GET) API can obtain commit information using a Jira issue key.

Usage example:

http://jira.yourorg.com/rest/gitplugin/1.0/issues/TST-234/commits

This API can be extended to review which files changed related to a specific Jira issue by adding ?showfiles=[true|false] (GET) as an optional parameter.

Usage example:

http://jira.yourorg.com/rest/gitplugin/1.0/issues/TST-234/commits?showfiles=true

For detailed information, usage and examples, see Hook and API Reference - Commits REST API open in new tab.

Branches REST API

This API will obtain list of branches associated to a Jira issue.  If the option parameter ?key={issuekey} is not defined, it will return all indexed git branches.

Usage example:

http://jira.yourorg.com/rest/gitplugin/1.0/issues/branches

For detailed information, usage and examples, see Hook and API Reference - Branches REST API open in new tab.

Tags REST API

This API returns several latest tags for the Jira issue.  The tags are sorted in chronological order from newest to oldest.

The result contains tag elements with basic information such as name of tag, associated commit data, associated repository settings, etc.  The hasMore flag in the result indicates if an issue contains more tags.

Usage example:

http://jira.yourorg.com//rest/gitplugin/1.0/issuegitdetails/issue/TST-435/tag

For detailed information, usage and examples, see Hook and API Reference - Tags REST API open in new tab.


Tracked Folders Jira Server Only

Manage git repositories page - Connect to git repository - Add tracked folder

This feature scans a locally accessible path for cloned Git repositories and automatically imports those Git repository references into Jira.  A repository group called TRACKED FOLDER is added in the Git add-on repository settings.

fyi
The add tracked folder feature requires that Jira and the git servers must be on the same filesystem.  Make sure that the user that Jira is running with has access permissions to the path with the git repositories.

The Add tracked folder wizard automatically adds the detected repositories to Jira.

fyi
You can add multiple tracked folders in case your repositories are spread among multiple locations.

When removing a tracked folder: Not available in Jira Cloud

  • Leave the checkbox unchecked to just remove the tracked folder setting from the repository configuration list.  (The local path for this tracked folder will still remain in the local system for later use); or
  • Tick the checkbox to permanently delete the tracked folder and its files from the local system.

If a new repository is manually added into the local path, the Git add-on will detect the new repository folder on the next reindex and add it into the existing tracked folder in Jira. ServerCloud

If a repository folder is manually deleted from the local path, the Git add-on will remove the repository setting from the tracked folder in Jira on the next reindex. ServerCloud

fyi
A similar feature is also present in supported Auto-connect integration of git host in Jira Server/Cloud.  However, you can only enable/disable a repository in the Show Tracked Repositories dialog in Jira Server.
Get new product notifications and feature updates from BigBrassBand LLC.
Need to know more features?  Read further at  Git Integration for Jira add-on Documentation