Adding read:jira-user permission to our app not working

Alex Chumbley
Contributor
February 14, 2021

We just added the User REST API and it says its enabled and gives us the option to "Configure" but it doesn't seem to be working. I don't see a link for it in the Oauth screen and also get an error that it's not added when trying to get an oauth page configured with this scope.

Any ideas on how to fix this?

Screen Shot 2021-02-02 at 1.16.09 PM.pngScreen Shot 2021-02-02 at 1.16.01 PM.pngScreen Shot 2021-02-02 at 1.16.25 PM.png

1 answer

0 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 18, 2021

Hello @Alex Chumbley ,

I am not sure I understand 100% what you are doing/trying to achieve since the screenshots are apparently missing. Therefore, can you kindly let me know the following:

  1. Confirm this is for Jira Cloud
  2. Confirm the endpoint you are trying to use
  3. Confirm your app uses OAuth 2.0 authorization code grants (3LO) 
  4. Provide more details on what you have done, what is the expected result and what you get instead.

 

Also, for the future, please notice that this is not the best place to get help on development  related questions. The right resources are listed in https://developer.atlassian.com/resources. 

Specifically:

 

Cheers,
Dario

Alex Chumbley
Contributor
February 18, 2021
  1. Yes, this is Jira Cloud API
  2. I am running 
    /rest/api/2/issue/FAB-1014
     to get the comment data on a particular ticket, then I'm running 
    rest/api/2/user/accountId=
     in order to pull user details to understand who is being @mentioned in a comment (if there is an @mention in a comment)
  3. Yes, we are using OAuth 2.0
  4. The error message is { "errorMessages": [ "OAuth 2.0 is not enabled for this method." ] }


    Thank you!
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 23, 2021

Hi @Alex Chumbley ,

One first thing I notice is that in your reply you say you are using:

rest/api/2/user/accountId=

Instead of:

rest/api/2/user?accountId=

 

Can you confirm you are using the correct endpoint? I believe you are, otherwise you should get 404 but I want to be sure.

Also, may I ask why you are using the REST API v2 instead of the v3? Are you maybe just using the 'latest' instead of the version number in the endpoint?

If that's the case, then you are most likely facing the below bug:

 

Finally, please notice that the endpoints you are using are part of the Jira Cloud Platform REST API, the User management ones are different  and are documented in the following page: https://developer.atlassian.com/cloud/admin/user-management/rest/intro/

 

Cheers,
Dario 

Alex Chumbley
Contributor
February 23, 2021

Hi Dario,

 

You're spot on, I needed to change it to

rest/api/2/user?accountId=

and no matter which version of the API I use (I've tried v2 and v3) I get the following error

{ "errorMessages": [ "Your app does not have scopes that are required to access this method ('read:jira-user')." ] }

 

This is exactly our problem. We've tried to add the scope `read:jira-user` to our app in the app console. But it's not updating our authorization URL, and we aren't receiving the scopes necessary to perform this query. This is what we are trying:

  1. Go to https://developer.atlassian.com/console/myapps/my_app_id/permissions
  2. User REST API is turned on, and we see "Configure" as the only option
  3. Clicking User REST API shows us that "View user profiles" is turned on
  4. We do not see the necessary scope (read:jira-user) in our OAuth authorization url

 

Are we missing something? Thank you!

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 24, 2021

Hello @Alex Chumbley ,

I have never done this myself since usually this kind of issues are discussed in the Developers Community, however you might just be configuring the wrong resource, as mentioned in my previous reply:

Finally, please notice that the endpoints you are using are part of the Jira Cloud Platform REST API, the User management ones are different  and are documented in the following page: https://developer.atlassian.com/cloud/admin/user-management/rest/intro/

 

Therefore, can you kindly check if in the developer console you have added "view users profile" scope to the Jira Platform REST API as shown in below screenshots:

Jira-platform-rest-API.jpgJira-platform-rest-API-2.jpg

 

 

Cheers,
Dario

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events