How to insert a custom table to JIRA DB ?

 

3 answers

This widget could not be displayed.

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?

Chris Fuller Atlassian Team Nov 05, 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.

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. 

 

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

Agree with Nic.

This widget could not be displayed.

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

@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

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. 

 

 

 

This widget could not be displayed.

Why do you need it?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

225 views 1 3
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