Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get an issue url that can be navigated to in the browser?

dataservice
Contributor
October 7, 2020

When using the rest api with oauth2, we access endpoints like so: 

https://api.atlassian.com/ex/jira/<cloud-id>/rest/api/2/issue/<issueIdOrKey>

As part of the integration we're building, we'd like to offer our users a link back to the issue on Jira Cloud's site, which from what I've seen is a link that looks like this: 

https://<user’s subdomain>.atlassian.net/browse/<issueKey>

 

Is there any way to get this link via the rest api? If not, is there any way to get the user's subdomain so that we can construct this url ourselves?

Things I've tried:

  1. The self field on issues- is in the api format, not the browser format
  2. Looked for some other "link" or "url" field among the list of all fields in our test instance. I couldn't find any that had this information
  3. Looked through the api documentation to find an endpoint for either the link or the user's subdomain. No luck.

1 answer

1 accepted

2 votes
Answer accepted
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 9, 2020

Hello @dataservice ,

As you noted the formatting for the issue URL is always going to be in the format:

https://<user’s subdomain>.atlassian.net/browse/<issueKey>

So I would recommend in your integration to set up output of the known value variables being base url and the issue key and combine them with the static value per the input URL format noted above as a hyperlink.

Example:

"https://"<$base_url> + "/browse/" + <$issue-Key>

You could pull the baseURL variable value from the systeminfo endpoint as well to use in formatting for a variable to combine with the other values:

Regards,
Earl

dataservice
Contributor
October 9, 2020

That works perfectly, thank you!

Like # people like this

Suggest an answer

Log in or Sign up to answer