Programming new Plugin connection to Jira Database

Hello all,

Imnew to Atlassian Developing and for a Project we have to develop a plug in that connects to the JIRA Database.
Im at a loss after scouring the Internet, I cannot seem to find a fitting solution.
Can you give me some ideas which classes to use in the JIRA rest API?

Thanks! 

1 answer

This widget could not be displayed.

Possibly.

First, we need to know what type of coding you are doing.  The options are broadly:

  1. Hacking the core of JIRA (To be avoided.  It leaves you unsupported and hard to upgrade, maintain, debug or change)
  2. Writing a type-2 plugin, which will be installed into a JIRA system and has direct access to the internal java APIs (JIRA Server only)
  3. Writing a Connect add-on, which will be installed into a JIRA system, but uses REST to do the work (JIRA Cloud only)
  4. Writing an external thing that runs outside JIRA and uses REST to do the work

I'm guessing you mean 2 or 3, but they make a bit less sense if we don't explain the full range.

Also, don't say "database" - you don't want to code for access to the database, it's not sane.  Always go through the APIs.

Hello Nic,

Thank you for your Answer. I think my Plugin would fall under number 2 of your description.

How would I go about it through the API?
I searched on google but could not find a fitting answer.

Do what?  You haven't explained what your add-on is going to do.  You've just said "connect to the database" which is, quite simply, the wrong way to approach doing things in JIRA.

Could you describe what your add-on is aiming to do, in terms of what the users might see or get?

The goal is to connect to the db, pull two numbers out, and create the sum and average value of these two numbers and then export the results to txt and pdf.
My job in this is only to realize the db connection to access the numbers.
This Project is part of a group project in which we are practicing Scrum, and creating a plugin for Jira.

Right.

Do not do it with a database connection.  It is the wrong approach.  Use the API.

What are these numbers?

These numbers are just dummy variables. The goal is to program a plugin that gathers information from the JIRA db about issues, progress, etc. and enable the user to generate reports.
My job is to implement the link between the report generation and the JIRA db.
How could I realize this with the API? All examples I found so far do not work because the imports cannot be resolved.

If your imports aren't resolving, then the code is broken (although I know getting the imports right are a pain when writing add-ons for Atlassian stuff).  It's worth going into a bit more detail I think.

Also, you probably need to define the questions you're looking to answer. 

If you really want totally open-ended reporting, then I'd lean toward moving to a database tool instead of trying to read the JIRA database in the application.  It's not built for reporting, but it can be used, especially if you use a product that understands the JIRA database would be best.  (I tend to avoid open-ended reporting - it usually leads to users coming to you to "explain why this report tells me X" and you spend hours working out that their reporting was built by the clueless and it's nonsense!)

If you want this reporting inside JIRA though, then definitely need to fix your imports!  Even if you weren't working with the API much, you'll still have problems.

How would I go about fixing the imports?
For example:
import com.atlassian.jira.rest.client.api.JiraRestClientFactory;
isn't resolving. (As are a bunch of other ones).

Well, that's no surprise.  JRJC is for coding something that runs outside JIRA, it can't be imported into an add-on because it's external (and add-ons simply don't need it - they already have access to the API)

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted 3 hours ago in Statuspage

What are your best incident management tips and stories? #HugOps

 👋Community members! Downtime happens. And great incident response takes a village. Teams like Support, Dev, SRE, Ops, IT, and Marketing have to come together to resolve the problem while keep...

19 views 0 2
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