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.

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

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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, } ] } ] }