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

Contact Support: Server  
Contact Support: Data Center  

Get Commits

Call the Get Commits REST API to obtain commit information associated with an issue.

VERSION 2.11.0+ The repository id and repository name field in the response result was implemented.

To perform the Get Commits API call, the Jira user must have the permission to **read** the requested issue.

Get Commits

url
/rest/gitplugin/1.0/issues/{issueKey}/commits

method
GET

Parameters

Parameter Condition
issueKey String. Required.

This is the Jira Issue Key – a concatenation of Project key and Issue number. It must contain a dash (‘-‘). The issueKey must be valid and existent.

For example: TST-234.

Response

Returns the result in the example below.

Example:

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

Returns the following example result:

{
  "commits":[
    {
    "author": "msmith <mark@bigbrassband.com>",
    "commitId": "34efa20372f0e2f0c9b705aacc57d7ad82e01426",
    "date": "2015-05-18T10:52:54.000+0000",
    "message": "TST-234 Update link in documentation",
    "repository": {  // INTRODUCED V2.11.0
        "id": 5,
        "name": "test repository name"
      },
      "branch": "master",
      "notes": {
        "refs/notes/commits": "TST-1 fixed also"
      },
    },
    {
    "author": "msmith <mark@bigbrassband.com>",
    "commitId": "52696c2d963be8986c7a2444b6473ea785632dce",
    "date": "2015-05-18T17:41:58.000+0000",
    "message": "TST-234 Remove libtiff dependency",
    }
  ]
}
Have feedback about this article? Did we miss something? Let us know!
On this page