How can I query for all users with the default avatar?

We have asked our user population to "change their avatar".  Is there a way for me to query all users with the default avatar assigned to their profile?

2 answers

If a user have not selected their own avatar they will not be in the JIRA avatar mysql-table. There is probably a nice nested query to see which users exist in the user table and cross reference it to the owner cell of the avatar table, but not being a great SQL ninja, i can only list the user that DID change their avatars by running

select distinct owner from avatar;

You should be able to do something like this:

select avatar.owner from avatar where avatartype='user' AND avatar.owner NOT IN (select cwd_user.lower_user_name from cwd_user);

Not sure where this breaks but if you have a DBA around maybe he can help you finetune it. Please post the answer here, it's good practice for my mysql-fu wink

 

Did some readin up.. This is how to display all users without a avatar picture:

select t1.lower_user_name from cwd_user t1 left join avatar t2 on t1.lower_user_name = t2.owner where t2.owner is null;

Enjoy!

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
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

211 views 1 18
Join discussion

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