SQL query for phone numbers

Hello everybody,

 

I have been trying the phone number of all the users from Confluence, but have not been able to find phone numbers in the database.

They are not located in the Active Directory.

I hope somebody can help me with this problem.

1 answer

1 accepted

1 vote
Accepted answer

Those values are stored in the in OS_PROPERTYENTRY table.
For user phone number, look for the row with the entity_key 
confluence.user.profile.phone.

 

select * from confluence.OS_PROPERTYENTRY where entity_key='confluence.user.profile.phone';

Thank you very much for the help.

I have not been able to see a foreign key on which I can get the user name. Is there a way to do this?

There was a CONTENT table in old releases and I was using below SQL to get user names also. But it is not working right now since there is no any table named as CONTENT

 

SELECT OS_PROPERTYENTRY.string_val, CONTENT.USERNAME
FROM confluence.OS_PROPERTYENTRY
INNER JOIN confluence.CONTENT
ON OS_PROPERTYENTRY.entity_id=CONTENT.CONTENTID
AND OS_PROPERTYENTRY.entity_key='confluence.user.profile.phone';

Thank you so very much for your help.

I added a join to user_mapping which gave me the user names.

SELECT OS_PROPERTYENTRY.string_val, user_mapping.USERNAME
FROM intranet.OS_PROPERTYENTRY
INNER JOIN intranet.CONTENT ON OS_PROPERTYENTRY.entity_id=CONTENT.CONTENTID
JOIN intranet.user_mapping ON CONTENT.USERNAME = user_mapping.user_key
AND OS_PROPERTYENTRY.entity_key='confluence.user.profile.phone';

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,037 views 15 13
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