I’m currently dealing with various Jira instances and I need to distinguish between cloud versions and on-premises setups based on API responses.
When I retrieve field data, I observed that the cloud version includes a distinct “key” field in its JSON output, whereas the on-premises version lacks this attribute.
I require a consistent method to differentiate between the two versions, as my application will be making a series of API calls for tasks such as creating issues, updating fields, and retrieving information. Simply relying on the presence of one field won’t suffice for all my operations.
Example response from Jira Cloud when fetching fields:
[
{
"id": "issuetype",
"name": "Issue Type",
"key": "issuetype",
"custom": false,
"orderable": true,
"navigable": true,
"searchable": true,
"clauseNames": [
"issuetype",
"type"
],
"schema": {
"type": "issuetype",
"system": "issuetype"
}
}
]
Example response from Jira On-Premises when fetching fields:
[
{
"id": "issuetype",
"name": "Issue Type",
"custom": false,
"orderable": true,
"navigable": true,
"searchable": true,
"clauseNames": [
"issuetype",
"type"
],
"schema": {
"type": "issuetype",
"system": "issuetype"
}
}
]
Is there a specific API method or endpoint that I can use to identify whether the instance is cloud-based or on-premises?