Hi, I wanted to get all the users through our JIRA and Confluence access using python REST API. Can you please suggest the best way to pull all user details from the platforms? Most vital elements required are the Names and email addresses.
@Rishi Jain Welcome to the community!
You have couple of ways to do this,
Thanks for your response. I could checkout API options where Get All Users needs admin access which I do not have and Bulk Get User needs user IDs to get other user details.
Holding a regular access, is there an API request which can allow me to fetch all user names and email addresses of the users in our network?
Also, if you can please share specific REST API url and method which can help me complete this task?
@Rishi JainYou don't need to be admin, you will just need Browse users and groups permission in your Jira.
API that you can use are,
Hi DPK,
Thanks for helping out again. The first link request "account id" to be passed - is this the account id of my user account for authentication purpose or the account id of user I need to pull the details for (in the latter, I need all account id's first, how do I get them all?)
In the second one, a query needs to be passed, what kind of query it needs? if I need to pull an email list and pass that on, then I do not get an opportunity to find the universe of users from my organization standpoint who have access to the platform.
Please advise how to structure any of these to get me all user details without any specific inputs.
Best,
Rishi Jain
I would suggest
GET rest/api/2/user/search?username=.&maxResults=1000&includeInactive=true
Unless your Jira has more than 1000 users that should give you all of the users. The REST API version 3 is still in Beta and you apparently have to go through some effort to get it working.
Sorry why username is '.' ? Is there documentation about this placeholder?
edit: the following observation resulted from a corrupted database
@Mark Thank you for pointing out this option to do the query by using API v2.This saved my day, as I cannot use API v3 in our environment.
As @Evgen Kyselgov pointed out, it would be nice if the documentation would describe how the username parameter is used to find user and what the '.' means.See Documentation: Jira 9.11.0 (atlassian.com)As I have a Jira environment with more than 1000 users, I played around with the startAt parameter, like: GET rest/api/2/user/search?username=.&maxResults=1000&includeInactive=true&startAt=1000This worked, but it threw an "500 Internal Server Error" at the point where startAt + maxResults exceeded the count of users in my environment
In my case: /api/2/user/search?username=.&maxResults=1&startAt=3964&includeInactive=true worked
/api/2/user/search?username=.&maxResults=1&startAt=3965&includeInactive=true failed with a 500 Error CodeI hope this information might be useful for someone else.
im using oauth application with read:jira-user permissions, and getting the 401 response code with getting users: get rest/api/2/users/.while others endpoints to get tickets and groups are working ok.can someone assist with it? @Mark @DPKJ @Evgen Kyselgov
It looks like you're new here. Sign in or register to get started.