October 11-13, 2022

GitKon 2022

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


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.

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

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

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

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