Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,366,304
Community Members
 
Community Events
168
Community Groups

How to get a URL for an issue that can be used in the browser?

After creating an issue using the API I need to return a URL that can be used to access the Issue through a web browser. After reading the docs and seeing the sample return value:

{
"id": "10000",
"key": "ED-24",
"self": "https://your-domain.atlassian.net/rest/api/3/issue/10000",
"transition": {
"status": 200,
"errorCollection": {
"errorMessages": [],
"errors": {}
}
}
}

I had planned on constructing it on my own by extracting the `your-domain` portion from `self` and build the URL like so:

{your-domain}.atlassian.com/browse/{key}

Unfortunately, the docs appear to be incorrect because instead of my subdomain being returned, that part of the `self` URL always contains `api`.  I cannot simply hardcode the subdomain because there are multiple subdomains in play.

Is it possible to get a usable URL from the response of a Create Issue request? 

1 answer

0 votes
Samuel Community Leader Sep 22, 2022

Your best bet would be to reconstruct the URL as the response won't return anything beyond what you posted above. Don't forget when reconstruction to use .net instead of .com!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events