Jira Cloud REST API via OAuth 2.0 - get absolute URL to Jira website for a given issue

I’m using Jira Cloud REST API to get a summary of a given issue, authorizing users via OAuth 2.0.
For example, to get all fields of issue “PROJ-35” I’m calling
https://api.atlassian.com/ex/jira/<cloud_id>/rest/api/2/issue/PROJ-35.

My problem is that I also need to provide an absolute URL of the issue, pointing straight to Jira website (e.g. https://<my_company>.atlassian.net/browse/PROJ-35).
Is there a way to get the Jira hostname, or just the portion I’m missing, somehow via REST API?

For Jira Data Center/Server this is not an issue, as REST API are called on the very same hostname as Jira website.

Thanks in advance for any help!

1 Like

Hi @lucap,

Have you looked into the Get Jira instance info endpoint? I think the displayUrl property might contain the path you’re looking for.

Kind regards,

Helen
Senior Developer Content Designer

1 Like

In addition to what @HelenOBoyle has advised, you can do also a lookup of the Issue via the Get issue endpoint, and the response contains the self object, which is the absolute path to that Issue.

Accessing an Issue directly via the absolute path is a better method than browsing for it via the {yourCompany}.atlassian.net/browse/{issueIdOrKey} technique.

1 Like