It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Unable to search issues using rest oauth

Hello Community !

I'm facing an issue with the REST Api while trying to search issues in a Jira Cloud instance.

I'm using the Java Rest Client from Atlassian.

I created an App and allowed it for my cloud jira, then created a code/state, generated a token, and tried to test some Rest queries, which worked.

For example, a list of project works well :

curl --request GET --url https://api.atlassian.com/ex/jira/(cloud_id)/rest/api/2/project --header 'Authorization: Bearer (token)' --header 'Accept: application/json'

But when I try to search for issues, it won't work.

Here is the query :

curl --request GET --url https://api.atlassian.com/ex/jira/(cloud_id)/rest/api/latest/search?jql=project%3DMSHUK&expand=schema,names&maxResults=0&startAt=0 --header 'Authorization: Bearer (token)' --header 'Accept: application/json'

And the error :

{"errorMessages":["OAuth 2.0 is not enabled for this method."]}

 

1 answer

0 votes
Andy Heinzer Atlassian Team Oct 23, 2019

Hi Frederic,

I understand that you are using the java rest client in an app, but getting back an error in regards to the REST API endpoint that app is trying to call.  Sorry for the inconvenience here, it seems that this has been documented as a bug.  Please see JRACLOUD-72126  for more details.

This particular bug appears to happen when called the /api/latest/ but does not seem to be happening when calling either the /api/2/ or /api/3/ (beta) endpoints.  As such, perhaps you can work around this problem by explicitly calling either the v2 or v3 endpoint instead of using the latest URI here.

I hope this helps.

Andy

Oh thanks for the answer Andy,

I'll try this as soon as possible, but it seems to fit the issue I'm facing.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

236 views 1 2
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you