what database table keep user properties?

does somebody know where in database JIRA keeps this user-properties?

4 answers

1 accepted

3 votes
Henning Tietgens Community Champion Mar 25, 2013

It's a combination of

external_entities on (user_name = external_entities.name)

propertyentry on (external_entities.id = propertyentry .entity_id)

propertystring on (propertyentry .id = propertystring .id)

WHERE

propertyentry.entity_name = 'ExternalEntity'

propertyentry.property_key = 'jira.meta.xxx'

xxx is the property name and propertystring.propertyvalue is the value

Henning

It looks like propertyentry.entity_id does not relate to external_entities.id any more, does it?

Well, in JIRA 6 one shall use app_user instead of external_entities

For JIRA 6, it is changed

 

SELECT
e.user_key,
t.property_key,
s.propertyvalue as FieldValue
FROM
app_user e 
JOIN propertyentry t
ON
e.ID = t.entity_id
JOIN propertystring s
ON
t.ID = s.ID
where t.property_key like 'jira.meta%';

Thank you very much :)

Thank you for this.

You can retrive property by programatically in future, you can use below code.

PropertySet properties;

properties=userPropertyManager.getPropertySet("USERNAME");

String x=properties.getString("jira.meta.x");

SQL:

select
  ps.propertyvalue
from
  propertystring ps,
  external_entities ee,
  propertyentry pe
where
  ee.name(+) = '<USERNAME HERE>' and
  pe.property_key(+) = 'jira.meta.' || '<PROPERTY KEY HERE>' and
  ee.entitytype(+) = 'com.atlassian.jira.user.OfbizExternalEntityStore' and
  ee.id = pe.entity_id(+) and
  pe.id = ps.id(+);

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...

289 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