How to insert a custom table to JIRA DB ?

fatma polat November 5, 2015
 

3 answers

3 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 5, 2015

Please, don't.  It's a pain in the neck to maintain, you will need to write piles of code to be able to use it, and JIRA will still ignore it on migration and upgrade.

What is the actual requirement that led you to this (very bad) idea?

crf
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 5, 2015

As Nic said, just plain don't. This is what Active Objects is for. It isn't perfect, but at least it's supported.

fatma polat November 9, 2015

We want to create tasks and subtask automatically from another sytem via web servis. We have different task types and different subtask types according to tasks type.

When we create tasks and subtasks, we need to know which subtask types are connected to task type. So we need to keep a mapping table.

After we received some comment from here, we decided to keep our mapping another DB.

Thanks. 

 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 9, 2015

>We want to create tasks and subtask automatically from another sytem via web servis. Ok, that does not need any new table or even mapping. Keep it simple - create the issues in JIRA via REST and add a custom field (not editable by users) that stores the extra mapping data you think you need.

Mario Günter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 9, 2015

Agree with Nic.

1 vote
Mike Rathwell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 6, 2015

Fatima,

I agree with what Nic says. Just... don't.

What I recommend (and have done) in both JIRA and Confluence is to add ANOTHER datasource to tomcat. If you need another whole table for whatever reason and/or want, perhaps, more functionality even that JUST what a table provides, another datasource can do the trick for you. You're going to have to do some scripting or use other plugins to render the data anyway from a custom table and (at least the ones I use) allow specifying the datasource.

Lemme know if this gets you along the way and feel free to ask more questions if this seems like the direction to go

mike

Chris Whitten [Comskil] March 7, 2016

@Mike Rathwell, do you have any more code or examples of doing this? I would be interested in being able to show data from another datasource in a custom field in a ticket upon ticket creation but I know there is potentially a lot of ways of doing this. I would love to learn more about how JIRA could be made to use other datasources at the same time its say using mysql for its DB. Thank you

Pablo Beltran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 7, 2016

Another alternative to adding a Datasource to Tomcat would be via the SQL for JIRA plugged tables feature: It allows to plug tables into the SQL for JIRA data model by providing a basic JIRA plugin. There is available a complete example with source code and even a video here:

https://kintosoft.atlassian.net/wiki/x/_YAU

The advantages of this approach is that you can combine your custom data with JIRA data via standard SQL.

For instance: You might want want to add some data from an external datasource ( not necessarly a relational database, it could be an Excel file, REST service, etc). Then plug your data via MYTABLE 

In this way you would be able to perform a SQL statement like:

select * from MYTABLE

If your table contains issue-related data (an issue key column for instance) then you could perform a SQL like:

select * from MYTABLE t inner join ISSUES i on i.key=t.issue_key 

This approach has additional advantages as there are free extensions on the Markeplace to show those queries as custom fields

https://marketplace.atlassian.com/plugins/com.kintosot.jira.jdbc4jql/server/overview

reporting, business analysis or built other JQL queries based on.

It might sound a bit complex now, for sure, bit it is a quite easy, flexible, powerful, long term, integrated and able to scale way solution. 

 

 

 

0 votes
Pablo Beltran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 8, 2015

Why do you need it?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events