How get baseurl in rovo agent forge app

Hi everyone,

I’m building a Forge Rovo agent that fetches filters and issues. When I look at the self field in the API response, I always get a link like this:

https://api.atlassian.com/ex/jira/<cloudId>/rest/api/3/...

But what I actually want is the Jira site base URL, for example:

https://my-site.atlassian.net

so that I can create user-facing links (like filter links or issue links).

Is there a recommended way to get the Jira base URL inside a Forge Rovo agent action?
Should I be using context.siteUrl from the payload, or is there another approach?

Thanks!

I am just giving my observation here, why don’t you directly use requestJira function to get the things you are trying to get

let response = await asUser().requestJira(route`rest/api/3/issue/{issueKey}`)

Did you try using such syntax to get response from your desired instance?

Yes I am doing this : const res = await api.asUser().requestJira(route`/rest/api/3/search?jql=assignee=currentUser() ORDER BY created DESC&maxResults=20`,

{ headers: { Accept: ‘application/json’ } } but not getting the correct url in self , I am getting : expand: ‘description,owner,jql,viewUrl,searchUrl,favourite,favouritedCount,sharePermissions,editPermissions,isWritable,approximateLastUsed,subscriptions’,
self: ‘https://api.atlassian.com/ex/jira/ec2761e9-b0d4-41a2-968c-b6f2586ab425/rest/api/3/filter/10066’,
id: ‘10066’,
name: ‘test2’
} but my instance is different from this .

Do you mean you want to make a request from one instance to another ?

no, I am making request from my instance and I am getting the response but in response I am getting different . Above I am getting self: ‘https://api.atlassian.com/ex/jira/ec2761e9-b0d4-41a2-968c-b6f2586ab425/rest/api/3/filter/10066’, in json but (https://api.atlassian.com/ex/jira/ec2761e9-b0d4-41a2-968c-b6f2586ab425/) is not my instance . I am creating an forge app using rovo agent module and getting this issue . Previously I have created many apps but not facing this type issue . I think now you are able to understand my query .

Using this request:

GET /rest/api/3/serverInfo

You will receive a payload with a context that will contain a cloudId

I try this and get this : 6e5d049d-adfe-4ac7-af28-302017a5dc9c Response {
status: 200,
statusText: ‘OK’,
headers: Headers {
date: ‘Mon, 22 Sep 2025 08:38:53 GMT’,
‘content-type’: ‘application/json;charset=UTF-8’,
server: ‘AtlassianEdge’,
‘timing-allow-origin’: ‘*’,
‘x-arequestid’: ‘437bd2ee9cf83cf090fe589b6f07f054’,
‘set-cookie’: ‘atlassian.xsrf.token=883e511cfa3360b265c41d8a9006e6a3004b517b_lin; Path=/; SameSite=None; Secure’,
‘x-aaccountid’: ‘712020%3Af59c6196-7c99-459e-bb68-a853ecb6058d’,
‘cache-control’: ‘no-cache, no-store, no-transform’,
‘x-ratelimit-limit’: ‘350’,
‘x-ratelimit-remaining’: ‘348’,
‘retry-after’: ‘1’,
‘x-ratelimit-reset’: ‘2025-09-22T08:38Z’,
‘ratelimit-reason’: ‘jira-burst-based’,
vary: ‘Accept-Encoding’,
‘content-encoding’: ‘br’,
‘x-trace-id’: ‘6e7d1b046f6140a691d62da9afac91bc’,
‘x-frame-options’: ‘SameOrigin’,
‘x-cache’: ‘Miss from cloudfront’,
via: ‘1.1 3ff110173726171f33d4ccc6ea6d6190.cloudfront.net (CloudFront)’,
‘x-amz-cf-pop’: ‘BOM54-P1’,
‘x-amz-cf-id’: ‘7fEOHhLlvV6mFiAy2I1Ibw1oqu5kL0g272JMV4yqkOvH0_FTB0Vm7w==’,
‘forge-proxy-upstream-latency’: ‘798’,
‘x-content-type-options’: ‘nosniff’,
‘x-xss-protection’: ‘1; mode=block’,
‘atl-traceid’: ‘65612b46c88345c0b5d0575ea4154553’,
‘atl-request-id’: ‘65612b46-c883-45c0-b5d0-575ea4154553’,
‘strict-transport-security’: ‘max-age=63072000; preload’,
‘report-to’: ‘{“endpoints”: [{“url”: “https://dz8aopenkvv6s.cloudfront.net”}], “group”: “endpoint-1”, “include_subdomains”: true, “max_age”: 600}’,
nel: ‘{“failure_fraction”: 0.001, “include_subdomains”: true, “max_age”: 600, “report_to”: “endpoint-1”}’,
‘server-timing’: ‘atl-edge;dur=810,atl-edge-internal;dur=4,atl-edge-upstream;dur=808,atl-edge-pop;desc=“aws-ap-south-1”’,
‘transfer-encoding’: ‘chunked’
},
body: ReadableStream { locked: false, state: ‘readable’, supportsBYOB: true },
bodyUsed: false,
ok: true,
redirected: false,
type: ‘basic’,
url: ‘https://forge-outbound-proxy.services.atlassian.com/fpp/provider/user/remote/jira’
} result , but not getting my instance or cloudId .

the object you pasted is just the Fetch API Response

Can you do this: await res.json() to read the full body.

That’s work , Thanks for helping me .