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

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

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

Field 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: TEST-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/TEST-123/commits?showFiles=true

Returns the following example result, if showFiles=true:

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

 

Commits REST APIs

Get Commits

showFiles (Commits REST API extension) (this page)

Get Commit Issue Changes

Update Commit Issue Changes

Merge Commit

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