Undefined site URL returned through Jira Clous REST API /rest/api/3/serverInfo

/rest/api/3/serverInfo

Please refer to for more details: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-serverinfo-get

export const getEnvironmentBaseUrl = async () => {
  // refer to: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-serverinfo-get
  try{
    const response = await api
      .asUser()
      .requestJira(route `/rest/api/3/serverInfo`);
  
    const serverInfo = await response.json();
    return serverInfo.baseUrl;
  }catch (error) {
    if (error instanceof SyntaxError) {
      console.error('SyntaxError in getEnvironmentBaseUrl: Cannot get base URL:', error.message);
    } else {
      throw error;
    }
  }
};

BTW: this site was migrated from on-premise to Cloud before.

2 Likes

hello @YY1 just tried the api call and worked fine using my cloud baseUrl got the needed info, consider checking the baseUrl, or maybe because of the migration the baseUrl used is the old on-premise one and not the cloud one, consider checking the baseUrl

1 Like

FYI if you have not seen it:

It might be related.

1 Like

Thanks, it seems correct for today :joy: @mohamadjawadAlHajjar

It seems to be related. Thanks @SilvreLestang

@YY1 so it’s a random day-to-day thing cool :joy:

1 Like

Maybe. Hopefully Atlassian developers could look into this issue. It has affected 3 customers of my Forge App: Sprint Reviewer | Atlassian Marketplace

3 Likes