How to get site Url using custom UI in forge Via javascript for Jira

Amusing Forge custom UI to bulid forge app. I need to get the instance or site URL Eg.

https://mysite.atlassian.net/

I have tried this javascript code


var params = new URLSearchParams(document.location.href);
alert('Instance full url : ' +params);

but it alerts
https://178d0956-3ce9-43b6-9642-b7e9c8b01388.cdn.prod.atlassian-dev.net

instead of

https://mysite.atlassian.net/

You can get this from the view object: https://developer.atlassian.com/platform/forge/custom-ui-bridge/view/#getcontext

2 Likes