I need to determine whether I’m working with Jira Cloud or Server (self-hosted) through API calls. When I fetch field information via REST API, I noticed the responses are slightly different. The cloud version includes a “key” property in the field data, but the server version doesn’t have this property.
Response from Jira Cloud when fetching fields:
[
{
"id": "priority",
"name": "Priority",
"key": "priority",
"custom": false,
"orderable": true,
"navigable": true,
"searchable": true,
"clauseNames": [
"priority"
],
"schema": {
"type": "priority",
"system": "priority"
}
}
]
Response from Jira Server when fetching fields:
[
{
"id": "priority",
"name": "Priority",
"custom": false,
"orderable": true,
"navigable": true,
"searchable": true,
"clauseNames": [
"priority"
],
"schema": {
"type": "priority",
"system": "priority"
}
}
]
I need to make various API calls for creating issues, updating them, and other operations. Checking for the “key” field every time isn’t practical for my use case. Is there a specific API endpoint that can tell me which type of Jira instance I’m connecting to?