Getting issue Url from Jira Cloud

Hey everyone,

This what my api call looks like:

The response and the (/editmeta) does not return any sort of URL that I can share and none of them match the URL from this copy link button, which I am trying to get.

Thanks in advance for the help!

Neither the baseUrl nor the URL to the end-user facing issue view is returned in Jira’s fetch issue API method. The good news is that the format is simply:

https://{instance.atlassian.net}/browse/{ISSUE-KEY}

You can extract the instance hostname from the self value returned in the JSON payload with something like this lightweight function:

function getHostname(data) {
  var a  = document.createElement('a');
  a.href = data;
  return a.hostname;
}

Then concatenate them all together to construct a shareable URL ("https://" + extracted hostname + "/browse/" + key [from JSON]).

1 Like