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

Contact Support

showFiles

Extend the Commits REST API to review which files changed related to a specific Jira issue by adding ?showfiles=[true|false] as an optional parameter.

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

showFiles (Commits REST API extension)

url

/rest/gitplugin/1.0/issues/{issueKey}/commits{?showFiles=[true|false]}

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-123.

?showFiles=[true|false] Boolean. Optional.

When set to true, this extends the commits API to display which files where changed related to a specific Jira issue.

See usage example below.

response Returns the result in the example below.

Example usage:

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

Returns the following example result, if showFiles=true:

{
  "commits": [
    {
      "author": "msmith <mark@bigbrassband.com>",
      "commitId": "257b4a8490270014922f3b821d61c86e76166dd9",
      "date": "2015-12-07 10:54:56 +0600",
      "message": "message with TST-123",
      "repository": {  INTRODUCED V2.11.0+
        "id": 5,
        "name": "test repository name"
      },
      "branch": "master",
      "notes": {
        "refs/notes/commits": "TST-1 fixed also"
      },
      "files": [
        {
          "path": "testFile2.txt",
          "linesAdded": 1,
          "linesChanged": 0,
          "linesDeleted": 0,
          "added": true,
          "deleted": false,
        }
      ]
    }
  ]
}

Related articles on Commits API

Get Commits

showFiles (this page)

Get Commit Issue Changes

Update Commit Issue Changes

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