The following PDFs show the database schemas for different Jira versions:
The database schema is also described in / in the Jira web application. The file has an XML definition of all Jira database tables, table columns, and their data type. Some of the relationships between tables also appear in the file.
To generate schema information for the Jira database, for example, like the previous PDFs, follow the instructions below. You can generate schema information in PDF, TXT, and DOT formats. Note that if you want to generate the schema in PDF format, you need to have Graphviz installed.
If you use Jira API, you will notice that a lot of code deals with objects. The is an OfBiz Entity Engine object. Each object represents a record in the database.
To get a value of a field from a , you will need to use the relevant getter method for the field's type.
1 2 3
GenericValue project = ... String name = project.getString("name"); Long id = project.getLong("id");
The list of valid fields for each entity can be obtained by looking for the entity's definition in the file. For the above example, you need to look at the "Project" entity.
Notes about working with the Jira database
For a great way to watch Jira database queries in action, try adding SQL Logging.
Custom fields have their own set of tables. For details, see Database – Custom fields.
Work log entries are kept in the table. For instance, some worklogs in Jira (from JRA-10393) are stored in table in the following way.
Implemented method to calculate number of active users + tests
Implemented a method to check if the user limit of the license has been exceeded.
Added new license types
|firstname.lastname@example.org||Integrate new license types in JIRA.||2008-01-22 23:51:email@example.com||200|
Whenever a worklog entry is added, the and values are incremented and decremented respectively.
Some of the relationships between Jira's tables in the database are documented in the following sections: