Create a Jira Issue in Database, directly.

Jonatan Soler January 1, 2012

regards

I need to create a jira incidence putting data directly into database.

I managed to insert it, but I do not directly appear in the navigation panel. I have to edit the incidence and implement changes so as to show me in that panel.

Anybody would know which tables are to affect to create an incident correctly?

10 answers

1 vote
Bob Swift (personal)
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.
January 1, 2012
The simple way to do this in a JIRA safe manner without programming is to use the JIRA CLI (command line interface). Almost any scripting or automation tool supports running commands.
Jonatan Soler January 2, 2012

This is my version: 3.12.3-#302

Maybe it's not compatible with CLI :S https://studio.plugins.atlassian.com/wiki/display/JCLI/JIRA+Command+Line+Interface#JIRACommandLineInterface-Examples

¿This is correct?

Bob Swift (personal)
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.
January 2, 2012

That is a very old version! However, createIssue is also an old capability and may work fine. If you look at v6 of that page's history it references your release for JCLI versions 1.0.0 through 1.5.0.

Jonatan Soler January 2, 2012
my problem is that this platform is mounted on a large company.

I have no permission to update the version
I have no right to choose the manner of integration (The best would be the library. Net)
I have no access to the trace of the last SQL queries
1 vote
Nic Brough -Adaptavist-
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.
January 1, 2012

Niels is absolutely correct, you can NOT insert data directly into the database.

Jira caches data. both on disk and in memory, and that can overwrite anything you try to push into the database. If you have no other option than a database change, then this caching means that you cannot do it while Jira is running.

There's no sneaky work arounds or fixes for this - you *will* break your Jira if you amend data in the database while it is running. (There are some minor exceptions to this, but not many, and none that I know of that allow alteration/creation of issue data).

You can modify data while Jira is offline. But if you do, you must re-index the issue(s) affected somehow, and at the moment, the only ways to do that are to modify the issue somehow and trigger it or re-index the whole system.

If you do want to insert issues, you need to stop Jira, insert into the issue table, (possibly custom field values), the os_ tables for the workflow status, and the project and issue counters. Then start Jira and re-index it.

In other words, your "quickest solution" won't work - you *must* come up with something else.

A re-index will fix the search problems you have now, but there's other problems you may have created.

Jonatan Soler January 1, 2012

i try to use the .net libraries and dont support https.

This is correct?

Nic Brough -Adaptavist-
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.
January 1, 2012

You can use any language that can talk to Jira via REST (or SOAP) if you want to do things externally. They should support https fine (the stuff I've written for it certainly does)

0 votes
Jonatan Soler January 2, 2012

RPC Services is the only way.

0 votes
Nic Brough -Adaptavist-
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.
January 2, 2012

You don't want to bother. Cleaning the caches is not going to help you with inserting data in the database, because you would need to lock out all the users, clean the caches, run your SQL, prompt it to rebuild the caches, prompt it to re-index any issues affected and then let your users back in. You'll also need to write code, at the very least a plugin, to trigger the cache changes, and there may well be caches in Tomcat you need to think about too. Stopping Jira and starting it again after your SQL is complete is a far more simple way to do it.

You really do need to tell your project manager that they're utterly wrong about using SQL and that they have damaged your database by doing it. Then tell them that they need to invest in a little external code or scripting to do this properly.

I'd take a good look at Bob Swift's CLI, as it's really good for scripting (I know you're on an old version of Jira, there are older compatible versions of the CLI available). If that still doesn't meet the needs, then I know a SOAP interface is possible in .NET (That's your favoured technology if I've read correctly)

0 votes
Jonatan Soler January 2, 2012

Yes, database direct is a wrong way.

But i've a proyect manager jeje

0 votes
NielsJ
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.
January 2, 2012

The safest way would be a restart. But I am not sure if there are any persistent caches that whould still be alive...

0 votes
NielsJ
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.
January 2, 2012

Yes, there is a cache directory. There could be caches in the database, too. I personally would prefer not to work with JIRAs database directly ;-)

0 votes
Jonatan Soler January 2, 2012
0 votes
Jonatan Soler January 2, 2012

how I can clean the internal jira's cache?

0 votes
NielsJ
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.
January 1, 2012

Hi Jonatan,

I think you shouldn't alter JIRA's database directly for creating issues. This might cause invalid system states. It is better to use a remote API such as REST: https://developer.atlassian.com/display/JIRADEV/JIRA+RPC+Services

If you do a manual insert once, you might need a complete reindex. But this is nothing that should be done regularly...

Regards,
Niels

Jonatan Soler January 1, 2012
For various reasons we decided that the quickest solution, but not the most stable, was that.

We managed to create the effects that data collected "Dynamics Nav" and importedcorrectly tour.

The only problem we have is that there are incidents, but are not reflected in thenavigation panel, horn button that you hit the edit, but do not make any changes.

Maybe I did not explain very well, I'm Spanish and a few phrases I have to use thegoogle translator

Suggest an answer

Log in or Sign up to answer