Skip to content

Store Jira server type in `jira_tracking_data` table

There are times when we need know what kind of server we're using, in order to issue the appropriate API call.

We should track this information in the jira_tracker_data table

For example, rest/api/2/serverInfo to a cloud instance gives

{
  "baseUrl": "the_url",
  "version": "1001.0.0-SNAPSHOT",
  "versionNumbers": [
    1001,
    0,
    0
  ],
  "deploymentType": "Cloud",
  "buildNumber": 100133,
  "buildDate": "2020-07-15T01:21:25.000-0700",
  "serverTime": "2020-07-15T08:56:35.890-0700",
  "scmInfo": "e2b9ca25fcf8535e74d29547edc867f25501bbde",
  "serverTitle": "Jira",
  "defaultLocale": {
    "locale": "en_US"
  }
}

rest/api/2/serverInfo to a server instance gives

{
  "baseUrl": "the_url",
  "version": "8.5.5",
  "versionNumbers": [
    8,
    5,
    5
  ],
  "deploymentType": "Server",
  "buildNumber": 805005,
  "buildDate": "2020-06-05T00:00:00.000+0000",
  "databaseBuildNumber": 805005,
  "serverTime": "2020-07-16T16:52:32.989+0000",
  "scmInfo": "a6982cff65627fb3fa50669b736095827f0ea0a7",
  "serverTitle": "JIRA"
}

We should store the deploymentType. At the moment this is enough to allow us to determine which API we can use. We can store additional information as the need arises.

Edited by Brett Walker