How to get URL to a created issue from API

Zharkyn Kassenov January 14, 2021

Hey there, I am creating issues using API, however, I cannot find URL for created issues in the response body.

 

How can I get the URL for a created issue using API?

 

Thanks!

4 answers

0 votes
Lukas Gotter _ Meetical
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 21, 2022

How about this

const issueUILink = issue.self.split('/rest/api')[0] + "/browse/" + issue.key;
0 votes
Zharkyn Kassenov January 17, 2021

Hi @Joshua Sneed Contegix , @Daniel Ebers ,

Thank you for your replies. What I was actually after is URL that can be opened in a browser to navigate to the created issue. I only see API URL of the issue in the response. Sorry for not being clear in the question.

Daniel Ebers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2021

Like Joshua showed there is the key as a response, this is the "dynamic" part of the URL, the rest is "static" like https://yourgreatsite.atlassian.net - the task would only be to concatenate your URL + the project key.

You mentioned you see only API URL in response key. I am unsure why - could you please show an anonymized output here?

Joshua Sneed Contegix
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2021

Hi Zharkyn,

Plug the key into Jira's standard issue URL to access it in the UI. E.g. http://www.example.com/browse/${key}. Cheers!

0 votes
Daniel Ebers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 16, 2021

Hi @Zharkyn Kassenov

in case it is still not working - could you probably post the response of your call here?
It then might be easier to dig in deeper.

Regards,
Daniel

0 votes
Joshua Sneed Contegix
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 14, 2021

Hi Zharkyn,

The Cloud Rest API documentation for issue creation shows that the issue key and URL are returned. Atlassian's example is below.

{
    "issues": [
        {
            "id": "10000",
            "key": "TST-24",
            "self": "http://www.example.com/jira/rest/api/2/issue/10000"
        },
        {
            "id": "10001",
            "key": "TST-25",
            "self": "http://www.example.com/jira/rest/api/2/issue/10001"
        }
    ],
    "errors": []}

 The id value is the issue ID, key value is the issue key, and the self value is the issue URL. Cheers!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events