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,
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.
Oh! my bad I guess linking got mixed up, API I was talking about is,
It will just need pagination data.
Now, for your knowledge, accountId parameter in API that I gave you previously was id of user of which you want to fetch information.
On second API, query parameter is kind of a search term, that will search into user's email and display name. I used this API to search for all my organization users by giving value of query parameter as 'YOUR_COMPANY_MAIL_DOMAIN', this will give you all use who have email id as, 'EMAIL_NAME'@'COMPANY_MAIL_DOMAIN'
Hi @DPK J , thanks for your help, the API did work and it is fetching me user accounts, however, I am receiving account IDs and Names of the users. I was hoping if the email id's were also a part of this API output since it is a user information itself. Please advise how to get that aswell through my outputs?
Also, instead of pagination i am using startAt and maxLength to fetch all the users. If there a way also to determine the number of users in total so I can make the maxLength a dynamic value?
Please advise and thanks again for all your help.
Update: while getting users using:
I am getting a 400 response for email request API calls, the text version of response says "Requestor must be a whitelisted app (not a user)." Please advise how to work around with this?
@Rishi Jain Oh! I forgot to mention both these API are in experimental tag, so to use them you need to build a app using Atlassian Connect ( https://developer.atlassian.com/cloud/jira/platform/getting-started/ )
There is no work around experimental API as of now.
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