I am trying to write an SQL query to collect various time-logged statistics. Time spent is stored in the Worklog table. It appears to me that the WORKLOG table has a key into the Jiraissue table via the issueid. The Jiraissue table has valuable information but I cannot see the link or location to where the Billing Account codes are stored. I have defined 4 accounts and linked projects and issues to these accounts. What I want to do is group (in SQL) by account. Can anyone help?
The issue and worklog tables are JIRA tables.
The Tempo account data is stored in a proprietary XML format that we can change the format/layout at any time. We do not support any direct access or manipulation of the data, but we do provide a simple servlet that returns a list of the accounts, see this site for further info:
Hope this helps!
The issue account is a normal custom field and is stored in the JIRA custom field tables. I didn't find your exact query, but here are some SQL examples that you can work from: https://confluence.atlassian.com/display/JIRACOM/Example+SQL+queries+for+JIRA#ExampleSQLqueriesforJIRA-GetCustomStringFieldforanIssue%28SqlServerfunction%29
Hope this helps,
P.S. If you are using the account as a worklog attribute, you need to query the property_entry and property_string tables by the worklog_id.
You join the worklog.id to the propertyentry.entity_id and the propertyentry.id to propertystring.id. Something like this:
select ps.propertyvalue from propertyentry pe, propertystring ps, worklog w, jiraissue ji where ji.pkey = 'TMA-3014' and ji.id = w.issueid and w.id = pe.entity_id and pe.entity_name = 'Tempo.Worklog' and pe.property_key = 'Tempo.WorklogAttributes' and pe.id = ps.id
Please note that is SQL is not supported and we will change this structure in the future.
Thank you for your quick reply.
For some reason we do not ave any propertyentry.Entity_Name with a value 'Tempo.Worklog'. We do have 'Tempo.Billing or 'Tempo.Config'.
Also, we have been trying to use the servlet but are receiving errors because our users are including HTML data in the Worklog Description. The error is something caused by HTML inside XML.
Is there a way we can prevent the Servlet from returning the Worklog Description?
The Tempo worklog attributes are currently stored as 'Tempo.Worklog' entries. If you don't have those you are not using the Tempo worklog attributes for the accounts but simply the JIRA custom field and you should therefore check the JIRA SQL page that I sent you before. You have probably stumbled up on the accounts config.
I don't think you can currently skip the worklog description from the servlet export.
Hope this helps,
This thread is a bit old, but I just had to work through modifying all of our Tempo Account keys and the worklogs associated with them. I've written about that here: https://medium.com/atlassian-adventures/changing-account-keys-in-jira-tempo-accounts-b3eb5a2d7de3
Thanks Eric, The attributes and the accounts are indeed cached and that is why you didn't see the changes in the UI immediately. (DB changes like these should never be done on a live system to avoid cache corruption.) Thanks for sharing and glad it worked for you :) -Bjarni
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!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG