customfield database queries


I would like to know whether its possible to query the Database for the following two scenarios:

  1. A list of all custom fields and there usage in issues (JQL: "custom field" is not EMPTY result) within one result table
  2. A list of all custom fields and their usage in issue screens (whether a custom field is "active" or not) within one result table.




3 answers

Hi Jan,

This is possible and you don't really need DBCF(unless you want to show this information over and over again, on every issue using DataTable CF). You only need Kepler Custom Fields(free, just like DBCF) and the sql routine.


You will need to set up a new datasource to access the JIRA database, it will be used as JNDI name in the sql routine or in the DBCF CF configuration. And now, the interesting part, the sql script:

, '|' as sep
, CF.*
, '|' as sep
, P.PKey || '-' || JI.IssueNum as IssueKey
from CustomFieldValue CFV
inner join CustomField CF on CFV.CustomField = CF.Id
inner join JiraIssue JI on CFV.Issue = JI.Id
inner join Project P on JI.Project = P.Id

The CFV table contains only the rows with values for the CFs.  The CF table contains the relevant information about the CF and finally, the JI and P tables will help you to get the issue key. I have used the || operator to concatenate some columns, you may need the concat function instead, depending on your SQL server type(MSSQL, MySQL, etc.).

You will probably want to select only the relevant columns from CFV and CF table, I have selected all the columns to have an overview on these tables.


Best regards,


Hi Silviu,

thanks for your answer. Maybe I'm too blind. What do you mean with "set up a new database source" ... "in sql routine"? Although everything is installed, I can't find the "sql routine". Do you anything like an documentation link (with pictures smile) for me?

Thanks & Regards,


Hi @Silviu Burcea,

thank you, it works. But the next question, after the result table is 1.400.000 rows long, is how can I sum up the result for every customfield, like:


| customfield_10001 | ABC | 12356 |

| customfield_10007 | Epic Link | 30000 |

| customfield_10008 | Sprint | 30000 |





Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,755 views 11 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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot