We have a cloud Jira setup, authenticated via Google. I followed the docs and created a token. When I do a curl -v https://<my_company>.atlassian.net --user me@my_company:mytoken, I get a 302 redirect to /secure/MyJiraHome.jspa. There are no headers returned with a session ID or similar.
If I try to view an issue, I get a 404 error: Issue does not exist or you do not have permission to see it.
curl -v --user me@my_company.com:token https://my_company.atlassian.net/rest/api/2/issue/RM-399
And yet the issue is clearly visible on the web at https://my_company.atlassian.net/browse/RM-399.
What am I missing?
So the answer was - don't make a typo! I misspelled my company's domain name; once I fixed it everything was good.
As Homer Simpson would say: Doh!
Thanks all for the help.
Hi Ken,
Technically, your curl command is correct and should return you the correct issue's data.
The 404 hints at an authentication problem, i.e. Jira doesn't know who you are and will simply pretend the issue isn't there. So, I am guessing that there is an issue with your token.
Also, curling 'https://<my_company>.atlassian.net' isn't much of test of your authentication, as it will always redirect you to '/secure/MyJiraHome.jspa' with 302, no matter if your credentials are good or not.
So, I suggest you check your API token or simply revoke the one you have and create a new one.
Hope that helps,
Oliver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Oliver, but it doesn't look like it's an authentication problem. Nothing changed when I got a new token.
One interesting thing: I tried listing my projects with
/rest/api/3/project/search?jql=&maxResults=50&startAt=0
Got a response indicating there are 0 projects:
{"self":"https://<my_company>.atlassian.net/rest/api/3/project/search?jql=&maxResults=50&startAt=0","maxResults":50,"startAt":0,"total":0,"isLast":true,"values":[]}
It's acting as if the API doesn't give me the same level of access to my company's projects as the web UI.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ken,
That's indeed quite strange. Have you tried accessing the API without any credentials – that should yield the same results as the ones you are describing.
If you are sure the credentials are correct, I really don't know what else to try. The API allowing for different levels of access for the same user would be news to me – although that would be an interesting feature. Anyway, it might be time for a support ticket.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks all. I've opened a support ticket with Atlassian; will let you know what they say.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ken Freeman
I would recommend trying the same API call in Postman (either the online version or via the downloaded app). This will confirm whether you have an authentication issue or not.
Go with a simple API call like https://my_company.atlassian.net/rest/api/2/issue/RM-399 to get it working
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.