March 28th 1 PM ET
Free Workshop: Escape the chaos of context-switching

Git Integration for Jira Self-Managed (Data Center/Server) Documentation

Bulk Import API

Starts the process of importing configuration and returns the result at once.

Only Jira admins can perform the Bulk Import API call.

Bulk Import Configuration

url

/rest/gitplugin/1.0/configuration.json

method

POST

Parameters

Parameter Condition
file Input the path to the tab-separated values (.TSV) file. See table below for details on each TSV file parameter.
confirmed-delete[ ] Optional.

Accepts multiple repository IDs confirmed for deletion. Input one or more repositories to delete, separated by commas.

Repositories won’t be deleted if it’s not in this list.

HTTP headers The request should contain the additional HTTP header:

X-Atlassian-Token: no-check

 

Request example

curl -vv -X POST -H "X-Atlassian-Token: no-check" -b "atlassian.xsrf.token=<token>;JSESSIONID=<session>;ROUTEID=.1" -F [email protected] http://<jira_url>/rest/gitplugin/1.0/configuration.json

 

Response

JSON
Returns the ID of the importing thread.

The Git Integration for Jira app will ignore fields with blank entries.

Download sample file
Right click and save the file below then extract to an easily accessible folder:
configuration_post.py

 


Example:

http://jira.example.org/rest/gitplugin/1.0/configuration.json

Response example:
{
  "success":false,
  "threadId":142
}

Usage:
Importing configuration from conf.tsv file:

user@home:~$ python configuration_post.py conf.tsv
{"success":false,"reposToDelete":[{"id":14,"description":"test-repo"},{"id":15,"description":"test-repo"}]}

Importing configuration from conf.tsv file with confirm delete:

user@home:~$ python configuration_post.py conf.tsv 14,15
{"success":false,"threadId":1058}

 

Field parameters

Refer to the parameters below when editing the TSV file:

Column/Field Description
id Integer. Required.

Assign an ID number to a repository. This is required if you wish to update or edit existing repositories by setting this value to their equivalent IDs. If this field is left blank, the repository will be created as new.

When importing to a new server, the id field must be blank.

realRoot StringOptional on existing servers.

This is the local path to the repository on the server where your Jira service is running. This will point the Git Integration for Jira app to a clone of the repository hosted locally with Jira.

This field corresponds to the Repository root input box in the Advanced setup/Repository settings.

The realRoot field may refer to an existing repository on a new server. If “root” doesn’t exist, this field must be blank.

If this field is specified, absoluteRoot must also be defined.

absoluteRoot Boolean. Optional.

This field corresponds to the Cloned root location input field in the Advanced setup/Repository settings.

If set to true, the repository is automatically managed by Git Integration for Jira app (stored in $JiraHOME).

If set to false, the repository is manually configured by the Jira administrator.

If this field is specified, realRoot must also be defined.

origin String. Required.

This is the URL to the hosted git service used on the project. For example, you might host your repository on GitHub, Beanstalk or your own server.

BigBrassBand recommends to use the git@<url>:[your-git-repo].git format for the repository origin URL and adding of SSH Keys for each git host in the Git Integration app configuration page.

For HTTPS git repositories, obtain the URL from your git host then set your login credentials in the username and password (or pat) field to connect to them.

The repository origin may not be hosted on the same server as Jira.

displayName String. Optional. Some git hosts may require this to be filled in.

Define a meaningful name for this repository configuration. If this field is left blank, the default value is obtained from the origin.

enableFetches Boolean. Optional.

Set to true to enable fetches on git repositories hosted on remote servers.

Set to false to enable fetches on git repositories hosted on the same server as Jira.

See Enable Fetches in section, Adding a repository via Advanced setup. The default boolean value for this field is true.

revisionIndexing Boolean. Optional. 

The default boolean value for this field is true.

This option turns on the memory cache which is used when list of commits are displayed. Set to true if revision indexing will index and link to any mentioned issue keys in the revision history or not (false).

mainBranch String. Optional.

Set specific branch as the main branch for this repository. The default value is “master”.

See Main Branch in section, Connecting a repository via Advanced setup.

username, password String. Optional.

Leave blank if 2FA is enabled for the git host.

pat String. Optional.

Required, if 2FA is enabled for the git host. This field accepts personal access token from supported git hosts.

gitViewerEnabled Boolean. Optional.

Enables or disables the Repository Browser feature for this repository.  The default setting for this option is enabled.

Users must have the View Development Tools project permission in order to use this feature.  Consult your Jira System Administrator on permissions.

For more information, see section, Repository Browser.

projectMapping Long [ ]. Array. Optional.

These are numeric projects IDs associated with the repository.

  • This field accepts list of comma separated project IDs for project mapping. Trailing spaces are ignored (equivalent to unchecking the Associate to All Projects checkbox in the Advanced Setup dialog). Example: 10000,10100
  • If you change an existing repository, leaving this field blank will use the existing values of the repository configuration.
  • Setting this field to ALL will retain projectMapping settings and sets “All Projects” flag to true (equivalent to checking the Associate to All Projects checkbox in the Advanced Setup dialog).

If projects are not associated to the repository, you must leave this field blank and set the gitViewerEnable field to false.

smartCommitsEnabled Boolean. Optional.

This setting is enabled by default. Enables/disables smart commits processing for this repository or tracked folder. The default value for this field is true.

sendCommitEmails Boolean. Optional.

Send commit notification emails for this repository. If left blank, the default value for this field is true.

maxMinsToCommitEmail Integer. Optional.

Set the desired value in minutes, as to when commit notifications will be sent. Commit notifications will be e-mailed if the age of the commit is less than or equal to this value. Default value is 1440 minutes.

webLinkType String. Optional.

Set web link type equivalent to the connected git host. Set web linking formats by referring to Git Integration for Jira: Web linking.

changesetFormat String. Optional.

This is the URL used to display revision. Use the following variable: ${rev} – git revision

fileAddedFormat, fileModifiedFormat, fileDeletedFormat String. Optional.

This is the URL to display content of added, modified or deleted files. Use the following variables:

  • ${num} – number of change (0, 1, …)
  • ${rev}  –  git revision
  • ${path} – path of the file being changed
  • ${parent} – parent git revision
  • ${blob} – ID of blob object
  • ${parent_blob} – ID of parent blob object
  • $convert(${branch},"subStr","newSubStr") – this inline function returns branch name with subStr replaced by a newSubStr. The ${branch} supports the character requirements on some hosting services.
mergeRequestFormat String. Optional.

This is the URL to display content of pull/merge requests on the git server. Use the following variables:

${mergereqId} – ID of the pull/merge request

branchLinkFormat String. Optional.

This is the URL to display a branch on the git server. Use the following variables:

${branch} – Name of the branch

disabled Boolean. Optional.

Add this repository into the Git Integration app configuration and set its status to updated (enabled) or disabled. If left blank, the default value for this field is false.

hosted Internal field. Read-only.

This field will show whether the repository is hosted on Jira or not.

tagsFilter String. Optional. 

Displays all tags for the specific issue, if left blank. Otherwise, set tags matching pattern to display tags on issue pages that match the specified regular expression pattern.

For more information, see example in Show tags.

Set tagsFilter with a valid Java regular expression or an empty string. The filtered tags are displayed on the Jira Developer Panel.

integrationType Flag. Internal field.

This field will show whether the repository is a tracked folder, a connected git service or a simple repository.

trackedFolderId Integer. Internal field.

This field will display the ID of the “parent” repository. It can be changed in order to convert the repository to a sub-repository.

Use with caution
If the modified sub-repository is not located in the tracked folder, it will be removed by the sequential auto-reindex.

delete String. Optional.

Enter “delete” on this column/field as a confirmation to the Git Integration app to automatically remove the selected repository from the plugin configuration. If left blank, no changes will occur.

sshKeyId Integer. Optional. This is the ID of an associated SSH key.
requireUserPat Boolean. Optional.

Setting this parameter to true will require users to specify their own PAT for branch and pull/merge request management.

sourcesDiffViewEnabled Boolean. Optional.

When enabled, this setting allows Jira users with the View Development Tools and correct Jira/Git Integration for Jira app permissions to view the commit and file diffs inside Jira.

sslVerify Boolean. Optional.

Default is true. The SSL Verify option is set to Enabled by default. If set to false, the Git Integration for Jira app will ignore verification of SSL certificates when connecting to a git server. This setting can also be accessed via Manage git repositories ➜ Actions ➜ Edit repository settings.

apiPath String. Optional.

The integration will use this relative REST API path starting with “/” to retrieve the list of tracked repositories. For more information, see Working with Custom API path.

apiFilter String. Optional.

JMESPath filter expression will be used to filter API results. See article Working with JMESPath filters or contact support for help writing expressions.

tfsCollection String. Optional. TFS or Azure DevOps Server integrations only.

A TFS collection is a group of TFS team projects. Specify an existing TFS Collection for use with Jira integration.

awsRegion String. Optional. AWS integrations only.

Specify a region for AWS CodeCommit integration. For region values, see AWS Regions and Endpoints.

Supported regions:

  • us-east-1
  • us-east-2
  • us-west-1
  • us-west-2
  • af-south-1
  • ap-east-1
  • ap-outh-1
  • ap-south-2
  • ap-northeast-3
  • ap-northeast-2
  • ap-southeast-1
  • ap-southeast-3
  • ap-southeast-2
  • ap-northeast-1
  • ca-central-1
  • eu-central-1
  • eu-central-2
  • eu-west-1
  • eu-west-2
  • eu-west-3
  • eu-south-1
  • eu-south-2
  • eu-north-1
  • me-central-1
  • me-south-1
  • sa-east-1
trustFolderStat Boolean. Optional.

When the trustFolderStat setting is set to false, the .git/objects/pack folder will be always scanned to check for new pack files. If set to true, the last-modified attribute of the folder will be used to check the folder for modifications.

The default value for Jira Data Center is false.

If your repository is stored on a network share, it is highly recommended to set the trustFolderStat value to false.

When adding new repositories, we recommend to leave the setting of the trustFolderStatvalue to false (default). You can change this setting later on via ActionsEdit repository settings in the Manage repositories page.

refSpecNotes Boolean. Optional.

This is a reference to refs/notes/* used for fetching. The default value for this field is true.

Git notes are not shown…

  • when refs/notes are disabled on connecting a repository;
  • when a new note comes when refs/notes is disabled.
refSpecChanges Boolean. Optional.

This is a reference to refs/changes/* used for fetching. The default value for this field is false.

refSpecCustom String. Optional.

This is a user-defined list of references used for fetching. It is a comma-separated list with the format: +refs/refname1/*:refs/refname1/*, refs/refname2/*:refs/refname2/*, …

prHideFilter String. Optional.
Displays all pull requests for the specific issue, if left blank. Otherwise, set pull requests matching pattern to hide pull requests on issue pages that match the specified regular expression pattern.

 

Take note that the .tsv file is verified by the Git Integration for Jira app with the following rules:

  • The header row is required.

  • The order of fields specified in the header row – is the order of the fields in the following rows.

  • If a field is omitted from the header row, the Git Integration app will use the default value for a new repository. The Git Integration app will keep the current value of a repository if it already exists in the configured repositories.

  • If a repository is not listed in the .tsv file, no changes will be made if the same repository exists in the Git Integration app configuration.

 

Bulk Change REST APIs

Have feedback about this article? Did we miss something? Let us know!
On this page