Documents for Jira Data Center
Breadcrumbs

Obtaining the list of previous versions of a document

On this page

You can obtain a list with the previous versions of a document by sending a specific HTTP GET request to the Jira instance running this version of Documents app. The result is returned in JSON format.

Request URL

The request URL takes the following form:
https:/ /MY_JIRA_BASE_URL/rest/stonikbyte-documents-api/1.0/document/{documentKey}/version
Replace "https:/ /MY_JIRA_BASE_URL" with the base URL of your Jira server.

Parameters

You have to specify the following parameters:

Parameter

Description

documentKey

Represents the key (unique identifier) of the document for which you want to obtain the previous versions.

An example of the request URL with parameters is as follows:

https:/ /myjiraserver:2990/jira/rest/stonikbyte-documents-api/1.0/document/31/version
In this example, all the previous versions of the document with the key 31 is returned.

A successful response

An HTTP 200 status response indicates a successful request.

JSON
{
  "versionNumber": 1,
  "currentRevision": "1.0",
  "revisionAuthor": "John Smith",
  "revisionDate": "2019-01-20 00:00:00.0",
  "revisionNotes": "First Draft",
  "createdBy":"admin",
  "dateCreated": "2019-01-22 06:30:36.0"
}

The following data is returned for each document version:

Data

Description

Example

versionNumber

The version number. The versions of each document are numbered starting from 1.

1

currentRevision

The Current Revision as it was in that document version

"1.0"

currentRevisionAuthors

The Revision Author(s) as it was in that document version

"John Smith"

revisionDate

The Revision Date as it was in that document version

"2019-01-20 00:00:00.0"

revisionNotes

The Revision Notes as it was in that document version

"First Draft"

createdBy

The Jira user who actually created this version in the Jira system

"admin"

dateCreated

The date when the version was created in the Jira system

"2019-01-22 06:30:36.0"

The folders do not have versioning, so the returned list will be always empty in their case.

Error Response

If the REST call fails, the service returns one of the following HTTP statuses:

HTTP Status Code

Description

401 Unauthorized

Returned for unauthenticated requests or in case of invalid Documents app license

403 Forbidden

If the user does not have View permissions over the document

You can form links to download the file of a specific document version by using the documentKey and versionNumber. The link is in form:
https:/ /MY_JIRA_BASE_URL/plugins/servlet/StonikByte/VersionOfDocument?documentId=519&versionNumber=2
In this example, the file attached to version 2 of the document 519 will be downloaded.