It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

SQL query for phone numbers

dseaalborg Nov 02, 2018

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
Answer accepted
Mesut Yilmazyildirim Nov 02, 2018

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';
dseaalborg Nov 02, 2018

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?

Mesut Yilmazyildirim Nov 02, 2018

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';
dseaalborg Nov 02, 2018 • edited

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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Confluence

6 Awesome Ways to Apply Trello, JIRA and Confluence to your Project

I attended  Atlassian Summit 2019  and learned a lot from the presenters, attendees and knowledgeable Atlassian product managers. The presentations I attended focused on applying Agile, pla...

2,595 views 12 29
Read article

Community Events

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

Events near you