create issue via plugin


i need to developpe a plugin that can import data from my table exesting in my database and present very row in this table as an issue please i need your help

4 answers

0 vote

That's quite a vagues question, you don't really tell us where you are stuck.

However, I'd look at the Jira importers - some of them can read data direct from a database and import the lines as issues.

In first, thinks for your answer, this is what i really need read data direcr from a database and import the lines as issues, i didn't find a tutorial or an answer for this question, please Nic if you have something to help please give it to me, think you, i forget i have a mysql table and each row i want present it as an issue

I'm not sure we can tell you a lot more.

You have a database table with issues in it - you need to convert that to a format Jira can read, and then you need to import it into Jira (then probably throw the database table away, as you've migrated it to Jira and don't need it any more)

Jira has some importers which can help you with it. The most simple approach really is to run simple SQL to get the data into a CSV format and import that.

Hi Asmaa,

You have to write your own migrator for it or you should use some tricks like below

Database to >> CSV and CSV to >> JIRA's CSV importer and map the fields and import.

below Java code will convert table data to csv file.


Onkar Ahire

public static void main(String[] args) {
          //usual database connection part
          Connection con = null;
          String url = "jdbc:mysql://localhost:3306/";
          String db = "db_name";
          String driver = "com.mysql.jdbc.Driver";
          String user = "username";
          String pass = "password";
          FileWriter fw ;
          con = DriverManager.getConnection(url+db, user, pass);
          Statement st = con.createStatement();
          //this query gets all the tables in your database(put your db name in the query)
          ResultSet res = st.executeQuery("SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'db_name' ");
          //Preparing List of table Names
          List <String> tableNameList = new ArrayList<String>();
          //path to the folder where you will save your csv files
          String filename = "D:/db2csv/";
          //star iterating on each table to fetch its data and save in a .csv file
          for(String tableName:tableNameList)
                int k=0;
                int j=1;
                List<String> columnsNameList  = new ArrayList<String>();
                //select all data from table
                res = st.executeQuery("select * from xcms."+tableName);
                //colunm count is necessay as the tables are dynamic and we need to figure out the numbers of columns
                int colunmCount = getColumnCount(res);
                 try {
                    fw = new FileWriter(filename+""+tableName+".csv");
                    //this loop is used to add column names at the top of file , if you do not need it just comment this loop
                    for(int i=1 ; i<= colunmCount ;i++)
                        for(int i=1;i<=colunmCount;i++)
                            //you can update it here by using the column type but i am fine with the data so just converting 
                            //everything to string first and then saving
                            String data= res.getObject(i).toString();
                            fw.append(data) ;
                                String data= "null";
                                fw.append(data) ;
                        //new line entered after each row
                } catch (IOException e) {
                    // TODO Auto-generated catch block
          catch (ClassNotFoundException e){
          System.err.println("Could not load JDBC driver");
          catch(SQLException ex){
          System.err.println("SQLException information");
    //to get numbers of rows in a result set 
    public static int  getRowCount(ResultSet res) throws SQLException
          int numberOfRows = res.getRow();
          return numberOfRows;
    //to get no of columns in result set
    public static int  getColumnCount(ResultSet res) throws SQLException
        return res.getMetaData().getColumnCount();

Hi Onkar, think you very very much for your help, you i didn't know that there is a difference between a simple csv and jira csv importer, i have two question in this point: 1-actually i have an evaluation version of jira i found a problem in the step Map fields i can't move to the next step, the second question the csv field can got a lot of lignes and each ligne associate them to an issue jira , think you again Onkar

Hi Asmaa,

With the help from External System Import in JIRA the below link is useful for you.


Onkar Ahire

Think's Onkar, i have an other request please do you have any idea about using API like create jira issue in a programme externe developping in eclipse??

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,345 views 14 20
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot