Is there a way to determine Jira infrastructure location through REST API?

Hi,

I’m developing my Forge application, on backend I need to know which infrastructure ( United States, Germany, Ireland, Singapore, or Australia ) is hosting Jira Cloud on which is my app installed.

Is this possible to read that information through Jira REST API?

I found on documentation something about server info https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-server-info/#api-rest-api-3-serverinfo-get but there’s no info about server location.

Hello @ukaszBoru

There is a hacky way of doing it, as described in this thread on the topic.

Once you extract the <meta name="ajs-region" content="..."> from the HTML response, the content attribute will contain a code that correlates to the AWS region that is hosting the instance.

Here is a list of AWS region codes from Amazon. You’ll have to manually work out what region relates to which code, as this list also contains the extra zone info, and there can be multiple zones for a region.

Remember, this is location of the compute part of the system and might not be where the data is residing.

1 Like

Wow, this is a really hacky way :laughing:, thanks for your comment.

@ukaszBoru . Just as a follow up on using that method to get an instance’s AWS region.

I did some tests against a few Cloud instances I know of in other regions and the content attribute returned in the ajs-region meta can often be totally different to any of Amazon’s published region codes. Also, sometimes other text prefixes the region code, such as prod-euwest (for Production somewhere in Western Europe, I assume), so making a ‘like-for-like’ comparison totally unpredictable.

So, unless Atlassian publishes a table of all the codes used for the different hosting locations for their Cloud products, you’re going to need to create your own table of region codes to compare against.

Just discovered another hacky way to find it out:

curl https://<your-instance>.atlassian.net/rest/api/3/serverInfo --raw -verbose

In the result there is a Server-Timing header. There you will see the exact AWS region.

The beauty of this method is that you don’t even need to be authenticated.

2 Likes

I found a simpler way to get the region where your Jira Cloud site is hosted — no need to use REST API or parse HTML.

If you’re building a Forge app, the region info is already included in the JWT token available in the runtime.

Here’s how you can get it:

import { __getRuntime } from "@forge/api";

export async function getRegion() {
  const token = __getRuntime().proxy.token;
  const payload = token.split('.')[1];
  const decoded = Buffer.from(payload, 'base64').toString('utf-8');
  const { productRegion } = JSON.parse(decoded);
  return productRegion;
}

This gives you a region code like:

  • us-east-1 → United States
  • eu-central-1 → Germany
  • ap-southeast-1 → Singapore

This method is clean, works directly inside Forge, and doesn’t require any external calls.

3 Likes