Access Permission using Jira Rest API

Pallavi Deore May 31, 2021

Hello All,

I am new to jira.

I need to access particular user permission using user key as we don't have account id for users.

Kindly let me know the uri for accessing user permission and to check whether that user is admin or not??

Thanks in advance

Pallavi Deore

 

2 answers

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.
June 5, 2021

Hi @Pallavi Deore

like Nir stated you can do a REST API call (using Jira server) like

https://jira.example.org/rest/api/2/user?username=johndoe

You will get (when doing the call while being logged in with administrator permissions) details like the username, the mail address, the full name, the time zone set for the user, the amount of groups the user is in.

However, it does not say anything about permissions. When wanting to know if the user is admin or not (I assume you mean member in jira-administrators) you still could do a REST API call like:

https://jira.example.org/rest/api/2/group/member?groupname=jira-administrators&includeInactiveUsers=false

Regards,
Daniel

0 votes
Nir Haimov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 31, 2021

Hi @Pallavi Deore 

Follow the API documentation, everything you need regarding API is there:

https://docs.atlassian.com/software/jira/docs/api/REST/8.13.0/#api/2-getPermissions

Pallavi Deore May 31, 2021

Hi @Nir Haimov 

I went through above documents which is helpful for fetching login user permission...

It response successfully for login user but for other user how I can fetch all permission using username, key, name or email address.

Even I tried using below url 

/rest/api/2/user/permission/search?username=pallavi

But not able to fetch permission of user pallavi.

Kindly suggest me urls for fetching particular user permission and to check that user is admin or not?

Thanks...

Nir Haimov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 1, 2021

Hi @Pallavi Deore 

it works like that:

/rest/api/2/user?username=user@company.com

Suggest an answer

Log in or Sign up to answer