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: |
?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
showFiles (Commits REST API extension) (this page)