How to create a Jira Issue from External database

Anitha July 9, 2014

Hi,

My Client is dumping all error details in a Oracle Database from various application and systems they have. I need to create JIRA Issue for each of those error records in that Oracle Database. There are various options I am Exploring:

  1. Use JIRA Issue Collector
  2. Use JIRA API

For using the first option, by calling the javascript, I see that it provides a javascript that can be launched from the a web application. We need this operation to be done in the backend by something that runs scheduled or so. So, this option is kind of ruled out.

For Using JIRA API, what are the APIs available? How can call this API, say from a database by passing parameters? I am thinking I will need to create a middleware java program to pull these records from the database. But what is that peice that I need to build at the JIra end and how do I expose it to this java program to call and create the issue? Or is there something available out of the JIRA that I can call from a middleware by passing parameters. My client has Oracle OSB middleware. Can we call soemthing from this layer to create Jira Issue?

3 answers

0 votes
Anitha July 16, 2014

Thanks Bob and Nic for the options. Will check the JIRA Command Line Interface (CLI) option as it sounds more compatible with the requirement that I have. Thanks again!!

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
July 10, 2014

JIRA Command Line Interface (CLI) has the runFromSql action which can create issues from information in a database. Or you can script individual createIssue actions. However, you probably need some external scripting to collect the data in an easier to deal with format with some queuing protocol so you can track what has been done and differentiate from new requests. You need to be careful to not miss data and not have duplicates. I have done this with a simple database table as the queue with timestamps and done flags etc... . Whatever you do, make sure you can track and log everything that is done up front or you will regret it later :).

0 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.
July 9, 2014

There's two basic approaches.

1. Write a plugin for Jira, or create Jelly scripts. This is reasonably easy until you get to the part about transmission - how does this *know* that there is data to be imported? Do you run it regularly and execute some form of search? Does it need to listen for messages on some form of bus/queue etc?

2. Probably the better option - write something outside Jira that can poke the data in. Jira exposes a REST interface which is ideal for this - you can use whatever language / system you have available (as long as it can issue REST calls) to enter the data whenever you need it. Java, c, python, shell scripts, I've even seen this done with database triggers.

For REST, have a look at https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Tutorials and https://docs.atlassian.com/jira/REST/latest/

Suggest an answer

Log in or Sign up to answer