How to get email ids of all users in Bitbucket

Hi, 

Since, there is no option of announcement banner in Bitbucket, I want to send email to all the users that are using Bitbucket about the downtime for upgrade activity. 

Is there any way to fetch the list of all the users of all the groups added in the global permissions of Bitbucket.?

By REST API or some other mean?

Any help will be appreciated.

 

Regards

sanand

2 answers

@sanan sanan

 

Hi Sanan

the rest api can be used, you could iterate over your user like

e.g

curl -u USER:PASSWORD https://BITBUCKETURL/rest/api/1.0/admin/users?filter=USERNAME

Another option could be to directly query the underlying database (mysql for example)

select user_name, email_address from cwd_user

The following link might also be interesting although i can not remember what informations are returned

https://confluence.atlassian.com/bitbucketserverkb/how-do-i-find-which-users-count-against-my-bitbucket-server-license-779171685.html

BR

Kurt

Hi Kurt, 

thanks for your response. 

I tried the curl command you suggested. it runs but returns no user names. It returns only following:

 

{"size":0,"limit":25,"isLastPage":true,"values":[],"start":0}

 

is there anything extra that I need to do?

 

I also tried the solution suggested in the link you pasted. but that does not help either. I installed the plugin mentioned therein but it gives me 404 error and a message as below:

Could not find servlet for: /plugins/servlet/users-with/LICENSED_USER

 

May be i should try your curl command if you can tel me what wrong I am doing. 

Regards

sanan

@sanan sanan

 

Can you provide the exact curl call you are using (without username & password)

 

BR

Kurt

Hi Kurt, 

 

sorry for my late reply. Actually, i just found a weird workaround. I opened the page of all the users and copied the whole table to excel sheet and filtered the rows of only those users who have last authenticated value. This way I got the users of LDAP who use or used Bitbucket. And got their email ids. So I got what I wanted.

 

Regards

sanan

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,755 views 1 5
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you