Forums

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

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

Broham
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 22, 2022

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
Sam Nadarajan
Community Champion
September 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
Product Admin
TAGS
AUG Leaders

Atlassian Community Events