Jira Ticket API returning invalid "self" URL - returns 404

Matt S January 26, 2024

Something has changed in the past day or so. When GET-ing a ticket from the Jira API, JSON is returned which contains "self" property that should point to a valid API URL for the ticket. The commonly used Jira Python library (and probably others) uses this URL to access/update the ticket. It trusts that the "self" URL is correct.

The API is returning a self URL like:
https://api.atlassian.com/rest/api/3/issue/123456

Which does not include the context path, it should be something like:
https://api.atlassian.com/ex/jira/aaaaaa-aaaaaa-aaaaaa-aaaaaa/rest/api/3/issue/123456

1 answer

0 votes
David Bakkers
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 26, 2024

Hello @Matt S 

I cannot replicate that. When I make a query to the v3 Get Issue endpoint, for a Jira Cloud instance, it returns the same self object that it always has, which is a URL to the issue in the domain:

"self": "https://<domain_name>.atlassian.net/rest/api/3/issue/<issue_id>"

exactly as per the documentation for that endpoint.

  1. What auth method are you using? Basic or OAuth 2.0?
  2. Which specific endpoint are you querying against?
  3. Did you get the same result when you tested your request using something else other than the Python library, like the default Requests library or a test tool like Postman
Matt S January 29, 2024

Hi David,

Using just curl on the command line, I've made a GET request to:
https://api.atlassian.com/ex/jira/04cae52b-048b-4f23-aebe-54cd1a912c80/rest/api/3/issue/45067/

 

And the self URL returned is:

https://api.atlassian.com/rest/api/3/issue/45067/45067

 

Thanks

David Bakkers
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 29, 2024

Hi @Matt S 

You didn't say which authentication method you are using. Querying against https://api.atlassian.com is only for OAuth 2.0 sessions. If using Basic auth, you just query against the URL for your cloud domain at https://<domain_name>.atlassian.net

Assuming you're talking about using OAuth2.0, I just did a test request using Postman via an OAuth 2.0 session to the same Get Issue endpoint as you've described:

Untitled.png

As you can see, I get back a top level self object with a URL that doesn't contain the CloudID. However, you can see that other self objects in the response such as fields>issueType>self do contain the CloudID in the URL.

When I test a few other GET endpoints, such as Get Project, I get a response that contains a top level self object that does contain the CloudID in the URL:

Untitled2.png

So, the top level self objects in the responses definitely are not consistent!

Personally, I don't have logs of prior OAuth calls to the Get Issue endpoint to know whether or not the top level self object in the response previously did return the CloudID in the URL compared to now, so I can't comment any further.

I suggest that if you're 100% sure the Get Issue response has recently changed and the top level self path is now invalid, then you open a support request with Atlassian.

David Bakkers
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 30, 2024

PS. @Matt S 

Someone else has reported a fault in this Developer forum thread where the self object suddenly changed for another API endpoint and is now being incorrectly returned.

Seems someone or something is making small changes to the REST API responses that are causing problems.

Suggest an answer

Log in or Sign up to answer